Giter VIP home page Giter VIP logo

sparkfun_lis3dh_arduino_library's People

Stargazers

 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

sparkfun_lis3dh_arduino_library's Issues

Library won't compile for ESP32

This error occurs when the MinimalistExample.ino sketch is compiled.

error: 'MSBFIRST' was not declared in this scope
SPI.setBitOrder(MSBFIRST);

Library Improvements

These possible improvements came up on the SF forums:
https://forum.sparkfun.com/viewtopic.php?f=83&t=52403&p=213211#p213211

The forum posts also include info on how to change to low power mode

  • Add a call to change to low power mode
  • Remove 'Wire.begin()' from the 'begin()' call (our new standard is to have users call this themselves so that they may choose things like clock frequency and it doesn't get overwritten by subsequent calls)
  • Allow users to specify their own I2C port (Wire, Wire1, Wire2, swWire, etc)

No Pedometer example provided

In examples readme we see line
Pedometer - Embedded function demonstrating step-counting feature
But I can't find this example

Fifo modes in example seem incorrectly commented

The source code of the library says:
uint8_t fifoMode; //can be 0x0,0x1,0x2,0x3

The FifoExample.ino says:
//fifoMode can be:
// 0 (Bypass mode, FIFO off)
// 1 (FIFO mode)
// 3 (FIFO until full)
// 4 (FIFO when trigger)

That seems inconsistent.

Shock detection example

I'm looking for a shock detection example with the LIS3DH, to detect the catch of a ball for instance.

FIFO Buffer is only 32 samples deep

Just a note that the FIFO buffer is only 32 samples deep.

So functions likes fifoThreshold() can only accept 0 though 31 not 32 as states in the code notes.

Example won't work for esp32

Hey Guys,
I am trying to use this library with my Esp32. The problem I experience is, that even the built already fails during the Arduino built process.

the error message is:

/home/user/Arduino/libraries/SparkFun_LIS3DH_Breakout/src/SparkFunLIS3DH.cpp: In member function 'status_t LIS3DHCore::beginCore()':
/home/user/Arduino/libraries/SparkFun_LIS3DH_Breakout/src/SparkFunLIS3DH.cpp:88:19: error: 'MSBFIRST' was not declared in this scope
SPI.setBitOrder(MSBFIRST);
^
exit status 1
Error compiling for board ESP32 Dev Module.

is MSBFIRST something like a environment variable for some boards?

Kind regards,
RSchlenker

Trouble using the LIS3DH accelerometer with the LSM6DS3 Gyroscope

Hi guys,

I'm trying to use an LIS3DH accelerometer with an LSM6DS3 gyroscope. However when I try to run the code, a library clash occurs between the libraries "SparkFunLIS3DH.h" and "SparkFunLSM6DS3.h". How can I work around this problem?

The error I receive is the following:

Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:38:2: error: redeclaration of 'IMU_SUCCESS'

IMU_SUCCESS,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:39:2: note: previous declaration 'status_t IMU_SUCCESS'

IMU_SUCCESS,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:39:2: error: redeclaration of 'IMU_HW_ERROR'

IMU_HW_ERROR,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:40:2: note: previous declaration 'status_t IMU_HW_ERROR'

IMU_HW_ERROR,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:40:2: error: redeclaration of 'IMU_NOT_SUPPORTED'

IMU_NOT_SUPPORTED,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:41:2: note: previous declaration 'status_t IMU_NOT_SUPPORTED'

IMU_NOT_SUPPORTED,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:41:2: error: redeclaration of 'IMU_GENERIC_ERROR'

IMU_GENERIC_ERROR,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:42:2: note: previous declaration 'status_t IMU_GENERIC_ERROR'

IMU_GENERIC_ERROR,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:42:2: error: redeclaration of 'IMU_OUT_OF_BOUNDS'

IMU_OUT_OF_BOUNDS,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:43:2: note: previous declaration 'status_t IMU_OUT_OF_BOUNDS'

IMU_OUT_OF_BOUNDS,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:43:2: error: redeclaration of 'IMU_ALL_ONES_WARNING'

IMU_ALL_ONES_WARNING,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:44:2: note: previous declaration 'status_t IMU_ALL_ONES_WARNING'

IMU_ALL_ONES_WARNING,

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:45:3: error: conflicting declaration 'typedef enum status_t status_t'

} status_t;

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:46:3: error: 'status_t' has a previous declaration as 'typedef enum status_t status_t'

} status_t;

^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:3:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LSM6DS3_Arduino_Library-master\src/SparkFunLSM6DS3.h:93:8: error: redefinition of 'struct SensorSettings'

struct SensorSettings {

    ^

In file included from C:\Users\Adel\Documents\Arduino\Gyro_and_Accel\Gyro_and_Accel.ino:2:0:

C:\Users\Adel\Documents\Arduino\libraries\SparkFun_LIS3DH_Arduino_Library-master\src/SparkFunLIS3DH.h:86:8: error: previous definition of 'struct SensorSettings'

struct SensorSettings

    ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I've also attached the code that I'm running, which is based on the MultiI2C example code provided for the LIS3DH by Sparkfun.
Thank you for your help,
Adel

Gyro_and_Accel.zip

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.