Coder Social home page Coder Social logo

adafruit_lis3dh's Introduction

Adafruit LIS3DH Build StatusDocumentation

This is the Adafruit LIS3DH breakout board library.

This sensor communicates over I2C or SPI (our library code supports both) so you can share it with a bunch of other sensors on the same I2C bus. There's an address selection pin so you can have two accelerometers share an I2C bus.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Kevin Townsend/Limor Fried for Adafruit Industries.
BSD license, check license.txt for more information All text above must be included in any redistribution

To install, use the Arduino Library Manager and search for "Adafruit LIS3DH" and install the library.

adafruit_lis3dh's People

Contributors

andydoro avatar caternuson avatar evaherrada avatar grandinquisitor avatar hathach avatar hoffmannjan avatar ladyada avatar microbuilder avatar patricklaf avatar petewall avatar ryan-feeley avatar sellensr avatar siddacious avatar tdicola avatar tyeth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_lis3dh's Issues

Acceleration values changing in step size of atleast 16

Hello

Thanks for providing libraries for this accelerometer. I have interfaced accelerometer with ESP32. I've observed one thing where if I keep my sensor in a stationary state or move it, the values change by at least the size of 16. I am attaching a screenshot of the values and the snippet code in txt file. Pls have a look at it. I have set my range at @2g. I have worked on MPU6050, where the values of acceleration in any particular axes didn't change by such a huge step(in this case at least 16)

I would really appreciate if you could throw some light on this and guide me where am I going wrong.
Thanks

accel_demo.txt

accel_op

FIFO mode is not available

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: Adafruit Huzzah ESP32

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.12

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

From the docs:

The LIS3DH embeds a 32-level FIFO for each of the three output channels, X, Y and Z.
This allows consistent power saving for the system, since the host processor does not need
to continuously poll data from the sensor, but it can wake up only when needed and burst
the significant data out from the FIFO.
In order to enable the FIFO buffer, the FIFO_EN bit in CTRL_REG5 (24h) must be set to ‘1’.
This buffer can work according to the following different modes: Bypass mode, FIFO mode,
Stream mode and Stream-to-FIFO mode. Each mode is selected by the FM [1:0] bits in
FIFO_CTRL_REG (2Eh). Programmable FIFO watermark level, FIFO empty or FIFO
overrun events can be enabled to generate dedicated interrupts on the INT1 pin
(configuration through CTRL_REG3 (22h)).
In the FIFO_SRC_REG (2Fh) register the EMPTY bit is equal to ‘1’ when all FIFO samples
are ready and FIFO is empty.
In the FIFO_SRC_REG (2Fh) register the WTM bit goes to ‘1’ if new data is written in the
buffer and FIFO_SRC_REG (2Fh) (FSS [4:0]) is greater than or equal to FIFO_CTRL_REG
(2Eh) (FTH [4:0]). FIFO_SRC_REG (2Fh) (WTM) goes to ‘0’ if reading an X, Y, Z data slot
from FIFO and FIFO_SRC_REG (2Fh) (FSS [4:0]) is less than or equal to
FIFO_CTRL_REG (2Eh) (FTH [4:0]).
In the FIFO_SRC_REG (2Fh) register the OVRN_FIFO bit is equal to ‘1’ if the FIFO slot is
overwritten.

Would y'all be open to a PR?

Data rate not be able to change

Thank you for sharing this library. When I set the data rate to be 50Hz, there is no difference compared to the default. No matter how I change the rate, the data is recorded eve
微信截图_20210104171512
ry 0.2 second (see below). Does this related to the mode of this accelerometer?

Accelerometer readings fluctuation when standing still, spindle vibration measurement

Hello. I am using LIS3DH acceleromerer module and have programmed it with the following sketch:


// Basic demo for accelerometer readings from Adafruit LIS3DH

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_LIS3DH.h>
#include <Adafruit_Sensor.h>


Adafruit_LIS3DH lis = Adafruit_LIS3DH();

void setup(void) {
  Serial.begin(115200);
  while (!Serial) delay(10);     // will pause Zero, Leonardo, etc until serial console opens

  Serial.println("LIS3DH test!");

  if (! lis.begin(0x18)) {   // change this to 0x19 for alternative i2c address
    Serial.println("Couldnt start");
    while (1) yield();
  }
  Serial.println("LIS3DH found!");

  //Serial.print(" trying to read register = ");
  //int reg_to_read;
  //reg_to_read = lis.read_register(LIS3DH_REG_CTRL4);
  //Serial.println(reg_to_read);



  // lis.setRange(LIS3DH_RANGE_4_G);   // 2, 4, 8 or 16 G!

  Serial.print("Range = "); Serial.print(2 << lis.getRange());
  Serial.println("G");

  lis.setDataRate(LIS3DH_DATARATE_10_HZ);
  Serial.print("Data rate set to: ");
  switch (lis.getDataRate()) {
    case LIS3DH_DATARATE_1_HZ: Serial.println("1 Hz"); break;
    case LIS3DH_DATARATE_10_HZ: Serial.println("10 Hz"); break;
    case LIS3DH_DATARATE_25_HZ: Serial.println("25 Hz"); break;
    case LIS3DH_DATARATE_50_HZ: Serial.println("50 Hz"); break;
    case LIS3DH_DATARATE_100_HZ: Serial.println("100 Hz"); break;
    case LIS3DH_DATARATE_200_HZ: Serial.println("200 Hz"); break;
    case LIS3DH_DATARATE_400_HZ: Serial.println("400 Hz"); break;

    case LIS3DH_DATARATE_POWERDOWN: Serial.println("Powered Down"); break;
    case LIS3DH_DATARATE_LOWPOWER_5KHZ: Serial.println("5 Khz Low Power"); break;
    case LIS3DH_DATARATE_LOWPOWER_1K6HZ: Serial.println("16 Khz Low Power"); break;
  }
}

void loop() {
  lis.read();      // get X Y and Z data at once
  // Then print out the raw data
  Serial.print("X:  "); Serial.print(lis.x);
  Serial.print("  \tY:  "); Serial.print(lis.y);
  Serial.print("  \tZ:  "); Serial.print(lis.z);

  /* Or....get a new sensor event, normalized */
  sensors_event_t event;
  lis.getEvent(&event);

  /* Display the results (acceleration is measured in m/s^2) */
  Serial.print("\t\tX: "); Serial.print(event.acceleration.x);
  Serial.print(" \tY: "); Serial.print(event.acceleration.y);
  Serial.print(" \tZ: "); Serial.print(event.acceleration.z);
  Serial.println(" m/s^2 ");

  Serial.println();

  delay(200);
}

It is slightly modified example from the adafruit library. I have only changed the datarate.

When the accelerometer is standing still, the measurement accelerations fluctuate quite a bit:

image

  1. It may deviate up to about 200 (Sometimes X is reading as little as 400 and sometimes even about 600 when standing still). I want to know whether this is normal or not.

2.. Is there a good way to calibrate it for my environment so when its standing where all the force is towards the Z axis, the other 2 axis should read as close to 0 as possible?

  1. For my application, I plan to measure cnc machine spindle vibration for school project. I wonder whether this deviation in readings will be enough to corrupt the readings in spindle vibration? Is this even possible?

Wrong divider values

Maybe I'm wrong but I think that the values for the divider in the code are wrong. For example: according to the datasheet (page 10) with FS bits set to 00 (2G), the mg/digit is 1. This means that the 12 bits value (with high resolution mode) express directly a value in mg (thousandths of G). Since the value in the registers is zero left padded, to convert it in G, it should be divided by 16000 (first divide by 16 to right shift by 4 and then by 1000 to pass from thousandths G to G) and not 16380. For the same reason, the divider for 4G should be 8000, at 8G 4000 and 1333 at 16G.
I did some tests with 3 different accelerometer and using my dividers I obtain values closer to 1 for the module (when the device don't move) than with your value.

Library prevents usage of 1.25kHz Normal Power Mode

  • Arduino board: Adafruit Feather M0 BLE

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.10

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):

According to Table 26 in the LIS3DH datasheet, there is a 1.25 kHz sample rate available using Normal Power mode. The settings for ODR0 - ODR3 are identical to those for 5kHz low-power mode, which is an optional sample rate provided by this library. However, low-power mode sacrifices resolution according to section 3.2.1 of the datasheet.

LIS3DH provides two different operating modes respectively reported as normal mode and
low power mode. While normal mode guarantees high resolution, low power mode reduces
further the current consumption.

I was able to work around this by making writeRegister8 a public method so the necessary settings could be changed. Here's my code to set configure the sensor:

  lis.setRange(LIS3DH_RANGE_8_G);
  lis.setDataRate(LIS3DH_DATARATE_LOWPOWER_5KHZ);
  // Disable LPen bit (for Normal power mode)
  lis.writeRegister8(LIS3DH_REG_CTRL1, 0b10010111);
  // Enable HR bit (for Normal power mode)
  lis.writeRegister8(LIS3DH_REG_CTRL4, 0b10100000);

Since this library does not provide any other way to access the low-power or high-res settings, this was the simplest approach.

Library doesn't compile with ATTiny85

Trying to get the LIS3DH sensor working with an ATTiny85, the library does not compile. Here is the error I get:

Arduino: 1.6.9 (Mac OS X), Board: "ATtiny25/45/85, ATtiny85, Internal 8 MHz"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/glen/Library/Arduino15/packages" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/glen/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/glen/Documents/Arduino/libraries" -fqbn=attiny:avr:ATtinyX5:cpu=attiny85,clock=internal8 -ide-version=10609 -build-path "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/glen/tmp/sketch_jul25c/sketch_jul25c.ino"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -hardware "/Users/glen/Library/Arduino15/packages" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -tools "/Users/glen/Library/Arduino15/packages" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/glen/Documents/Arduino/libraries" -fqbn=attiny:avr:ATtinyX5:cpu=attiny85,clock=internal8 -ide-version=10609 -build-path "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/glen/tmp/sketch_jul25c/sketch_jul25c.ino"
WARNING: Spurious .github folder in 'Adafruit LIS3DH' library
Build options changed, rebuilding all
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH/Adafruit_LIS3DH.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/Wire.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/dev/null"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp" -o "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/sketch/sketch_jul25c.ino.cpp.o"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH/Adafruit_LIS3DH.cpp" -o "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/libraries/Adafruit_LIS3DH/Adafruit_LIS3DH.cpp.o"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/Wire.cpp" -o "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/libraries/Wire/Wire.cpp.o"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -mmcu=attiny85 -DF_CPU=8000000L -DARDUINO=10609 -DARDUINO_attiny -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Users/glen/Library/Arduino15/packages/attiny/hardware/avr/1.0.2/variants/tiny8" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src" "-I/Users/glen/Documents/Arduino/libraries/Adafruit_Sensor" "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c" -o "/var/folders/g5/_p40z6fj53z45x1xvgvxc3g80000gn/T/buildfb32aecad0cc70c77d8b1590509dca12.tmp/libraries/Wire/utility/twi.c.o"
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_init':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:76:16: error: 'SDA' undeclared (first use in this function)
   digitalWrite(SDA, 1);
                ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:76:16: note: each undeclared identifier is reported only once for each function it appears in
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:77:16: error: 'SCL' undeclared (first use in this function)
   digitalWrite(SCL, 1);
                ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:80:7: error: 'TWSR' undeclared (first use in this function)
   cbi(TWSR, TWPS0);
       ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:80:3: note: in expansion of macro 'cbi'
   cbi(TWSR, TWPS0);
   ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:80:13: error: 'TWPS0' undeclared (first use in this function)
   cbi(TWSR, TWPS0);
             ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:80:3: note: in expansion of macro 'cbi'
   cbi(TWSR, TWPS0);
   ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:81:13: error: 'TWPS1' undeclared (first use in this function)
   cbi(TWSR, TWPS1);
             ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:81:3: note: in expansion of macro 'cbi'
   cbi(TWSR, TWPS1);
   ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:82:3: error: 'TWBR' undeclared (first use in this function)
   TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
   ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:90:3: error: 'TWCR' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA);
   ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:90:14: error: 'TWEN' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA);
              ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:90:26: error: 'TWIE' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA);
                          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:90:38: error: 'TWEA' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA);
                                      ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_disable':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:102:3: error: 'TWCR' undeclared (first use in this function)
   TWCR &= ~(_BV(TWEN) | _BV(TWIE) | _BV(TWEA));
   ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:102:17: error: 'TWEN' undeclared (first use in this function)
   TWCR &= ~(_BV(TWEN) | _BV(TWIE) | _BV(TWEA));
                 ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:102:29: error: 'TWIE' undeclared (first use in this function)
   TWCR &= ~(_BV(TWEN) | _BV(TWIE) | _BV(TWEA));
                             ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:102:41: error: 'TWEA' undeclared (first use in this function)
   TWCR &= ~(_BV(TWEN) | _BV(TWIE) | _BV(TWEA));
                                         ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:105:16: error: 'SDA' undeclared (first use in this function)
   digitalWrite(SDA, 0);
                ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:106:16: error: 'SCL' undeclared (first use in this function)
   digitalWrite(SCL, 0);
                ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_setAddress':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:118:3: error: 'TWAR' undeclared (first use in this function)
   TWAR = address << 1;
   ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_setFrequency':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:129:3: error: 'TWBR' undeclared (first use in this function)
   TWBR = ((F_CPU / frequency) - 16) / 2;
   ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_readFrom':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:187:7: error: 'TWDR' undeclared (first use in this function)
       TWDR = twi_slarw;
       ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:188:13: error: 'TWCR' undeclared (first use in this function)
     } while(TWCR & _BV(TWWC));
             ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:188:24: error: 'TWWC' undeclared (first use in this function)
     } while(TWCR & _BV(TWWC));
                        ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:189:16: error: 'TWINT' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:189:29: error: 'TWEA' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                             ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:189:41: error: 'TWEN' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                                         ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:189:53: error: 'TWIE' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                                                     ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:193:65: error: 'TWSTA' undeclared (first use in this function)
     TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTA);
                                                                 ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_writeTo':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:269:7: error: 'TWDR' undeclared (first use in this function)
       TWDR = twi_slarw;    
       ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:270:13: error: 'TWCR' undeclared (first use in this function)
     } while(TWCR & _BV(TWWC));
             ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:270:24: error: 'TWWC' undeclared (first use in this function)
     } while(TWCR & _BV(TWWC));
                        ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:271:16: error: 'TWINT' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:271:29: error: 'TWEA' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                             ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:271:41: error: 'TWEN' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                                         ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:271:53: error: 'TWIE' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE); // enable INTs, but not START
                                                     ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:275:65: error: 'TWSTA' undeclared (first use in this function)
     TWCR = _BV(TWINT) | _BV(TWEA) | _BV(TWEN) | _BV(TWIE) | _BV(TWSTA); // enable INTs
                                                                 ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_reply':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:357:5: error: 'TWCR' undeclared (first use in this function)
     TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
     ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:357:16: error: 'TWEN' undeclared (first use in this function)
     TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
                ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:357:28: error: 'TWIE' undeclared (first use in this function)
     TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
                            ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:357:40: error: 'TWINT' undeclared (first use in this function)
     TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
                                        ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:357:53: error: 'TWEA' undeclared (first use in this function)
     TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
                                                     ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_stop':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:372:3: error: 'TWCR' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
   ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:372:14: error: 'TWEN' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
              ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:372:26: error: 'TWIE' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
                          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:372:38: error: 'TWEA' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
                                      ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:372:50: error: 'TWINT' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
                                                  ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:372:63: error: 'TWSTO' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO);
                                                               ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'twi_releaseBus':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:393:3: error: 'TWCR' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
   ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:393:14: error: 'TWEN' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
              ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:393:26: error: 'TWIE' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
                          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:393:38: error: 'TWEA' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
                                      ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:393:50: error: 'TWINT' undeclared (first use in this function)
   TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
                                                  ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/compat/twi.h:36:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:27:Using library Adafruit_LIS3DH at version 1.0.3 in folder: /Users/glen/Documents/Arduino/libraries/Adafruit_LIS3DH 
Using library Wire at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire 
Using library Adafruit_Sensor at version 1.0.2 in folder: /Users/glen/Documents/Arduino/libraries/Adafruit_Sensor 

/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c: In function 'TWI_vect':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:401:10: error: 'TWSR' undeclared (first use in this function)
   switch(TW_STATUS){
          ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:401:10: error: 'TWS7' undeclared (first use in this function)
   switch(TW_STATUS){
          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:401:10: error: 'TWS6' undeclared (first use in this function)
   switch(TW_STATUS){
          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:401:10: error: 'TWS5' undeclared (first use in this function)
   switch(TW_STATUS){
          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:401:10: error: 'TWS4' undeclared (first use in this function)
   switch(TW_STATUS){
          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:401:10: error: 'TWS3' undeclared (first use in this function)
   switch(TW_STATUS){
          ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:406:7: error: 'TWDR' undeclared (first use in this function)
       TWDR = twi_slarw;
       ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:426:4: error: 'TWCR' undeclared (first use in this function)
    TWCR = _BV(TWINT) | _BV(TWSTA)| _BV(TWEN) ;
    ^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:25:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:426:15: error: 'TWINT' undeclared (first use in this function)
    TWCR = _BV(TWINT) | _BV(TWSTA)| _BV(TWEN) ;
               ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:426:28: error: 'TWSTA' undeclared (first use in this function)
    TWCR = _BV(TWINT) | _BV(TWSTA)| _BV(TWEN) ;
                            ^
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src/utility/twi.c:426:40: error: 'TWEN' undeclared (first use in this function)
    TWCR = _BV(TWINT) | _BV(TWSTA)| _BV(TWEN) ;
                                        ^
exit status 1
Error compiling for board ATtiny25/45/85.
  • Board: ATTiny85
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.6.9
  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):
  1. Try to compile this sketch with the following settings:
#include <Adafruit_LIS3DH.h>
void setup() {
}
void loop() {
}

image
(This screenshot is an attempt to show the core files we're using, the board settings, and the version number of the Adafruit LIS3DH library we're using.)

It seems this error is caused by including Wire.h and/or SPI.h. Any ideas about why this library won't compile for this chip?

(cc @damellis, @mmachenry)

Interrupt pin always HIGH after version 1.1.3 for Attinyxy4

After the update was made to use BusIO, the interrupts stopped working for the new ATTINY series.

The interrupt pin will always be HIGH, regardless of if it's moving or standing still.
Version 1.1.2 doesn't have this issue.

Using this sketch which runs some neopixels whenever an interrupt is received: https://gist.github.com/JasXSL/ed0f35498f64f8736e2fa730bde88b75

On 1.1.2 the pixels are off until a shake is detected (expected behavior), on later versions the pixels are always on.

Using:

How to select between multiple HW SPI interfaces

Hello. I am using this library for my ESP32 device. The ESP32 has 2 available SPI interfaces. When I initialise the LIS3DH using HW SPI interface the following method is executed:

Adafruit_LIS3DH::Adafruit_LIS3DH(int8_t cspin, SPIClass *theSPI) {
  _cs = cspin;
  _mosi = -1;
  _miso = -1;
  _sck = -1;
  _sensorID = -1;
  SPIinterface = theSPI;
}

I think by default. the ESP32 selects GPIO23(MOSI), GPIO19(MISO), SCLK(18) as HW SPI, but what about other HW SPI pins? GPIO12(MISO), GPIO13(MOSI), GPIO14(CLOCK) how can I select those if in my custom PCB I have used those as my SPI pins?

If I create them as part of Software SPI even though they are hardware SPI pins , is there gonna be any drawbacks?

"Fluctuating" accel. outputs

Hi there, I am currently running 4 LIS3DH chips in SPI configuration, outputting accel data @ 12bit (high res) 200Hz, +/- 2gs configuration.

The chips are not moving, and I noticed from the serial output terminal that the x,y,z acceleration value fluctuates in random intervals. The fluctuation applies throughout all of the LIS3DH chips, and is consistently scaled (up/down) by 2 on all acceleration axes output, in the same set of readings.
(e.g. x:1.01 y:-0.06 z:9.50m/s^2 fluctuates to x:2.09 y:-0.25 z:19.08m/s^2 in the next data set).
The raw value seems to have this pattern of fluctuation as well (scaled by 2). (e.g. z raw: 15936 to 31424).

Am I missing something? Anyone have a similar encounter? Thanks!

Accelerometer readings without using FIFO

Hello. I am using accelldemo example provided with the library. If I understand correctly, lis.read() function reads the accelerometer data using FIFO method. Is there an example code that I can use to read the data without the FIFO?

I am experiencing some fluctuation in accelerometer readings (noisy output), I have read the following thread:
https://community.st.com/s/question/0D50X00009XkXrR/lis3dh-z-output-noisy
and someone suggested turning OFF fifo and just reading the data regularly. I wonder whether that would provide more accurate output

Setting resolution & BDU on incorrect register?

  • Arduino board: AdaFruit Feather M0 BLE

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.10

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): N/A

I want to set the high-res bit, which is defined on LIS3DH_REG_CTRL3. However, it looks like it's being incorrectly set to LIS3DH_REG_CTRL4 in Adafruit_LIS3DH.cpp

Since writeRegister8 is a private method, I cannot override this without modifying the library outside of my own code (not a best-practice).

I'm happy to submit a PR to fix this, but would first like a maintainer to confirm the issue.

Thanks!

Wrong read on Arduino Nano

On Arduino Nano, the read() method gives wrong data.
When X changes, it impact Y and Z readings.
When Y changes, it impacts Z and readings.
This seems to come from the burst read of x,y, and z value (I2C read with autoincrement).
When I patch the library to read these data with separate readRegister8() calls, it works OK.

Docs not updating

Run bash ci/doxy_gen_and_deploy.sh
Setting up the script...
Cloning into 'Adafruit_LIS3DH'...
Generating Doxygen code documentation...
Grabbing default Doxyfile
This is a Commit, Uploading documentation...
Uploading documentation to the gh-pages branch...
Adding all files
Changes to commit
Git committing
[gh-pages ec835a5] Deploy docs to GitHub Pages from commit ce859eafe7
 1 file changed, 1 insertion(+), 1 deletion(-)
Git pushing
Error: Process completed with exit code 128.

How to read and print out the value of the register

I have added my own custom function to Adafruit_LIS3DH library:

uint8_t Adafruit_LIS3DH::read_register(uint16_t register){
    Adafruit_BusIO_Register reg_to_read = Adafruit_BusIO_Register(
    i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, register, 1);
    return reg_to_read.read();

}
  

I simply want to be able to read a value in a register, and from what I am aware, there is no such possibility in the library so I have added my own. So as an argument, I want to be able to pass an address of the register ( for example LIS3DH_REG_CTRL4) this is a keyword defined in header file.

In my arduino main file, I am calling this function:

  int reg_to_read;
  reg_to_read = lis.read_register(LIS3DH_REG_CTRL4);
  Serial.println(reg_to_read);

But it is not working for some reason, the error message is displayed:

C:\Users\petrikas.lu\Documents\Arduino\libraries\Adafruit_LIS3DH-master\Adafruit_LIS3DH.cpp: In member function 'uint8_t Adafruit_LIS3DH::read_register(uint16_t)':
C:\Users\petrikas.lu\Documents\Arduino\libraries\Adafruit_LIS3DH-master\Adafruit_LIS3DH.cpp:468:66: error: expected primary-expression before '(' token
     Adafruit_BusIO_Register reg_to_read = Adafruit_BusIO_Register(
                                                                  ^
C:\Users\petrikas.lu\Documents\Arduino\libraries\Adafruit_LIS3DH-master\Adafruit_LIS3DH.cpp:469:45: error: expected primary-expression before 'register'
     i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, register, 1);
                                             ^

It somehow does not like that I want to pass the register as an argument, can someone clarify to me why is that?

If I change my function and hardcode the register into it, it works without any issues:

uint8_t Adafruit_LIS3DH::read_register(uint8_t register){
    Adafruit_BusIO_Register reg_to_read = Adafruit_BusIO_Register(
    i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LIS3DH_REG_CTRL4, 1);
    return reg_to_read.read();

}

Notice in the code above, I have hardoced LIS3DH_REG_CTRL4 for the reg_to_read and that seems to work fine! How can I get it to work if I want to pass an address like an argument to the function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.