arduino-libraries / Arduino_LSM6DS3

LSM6DS3 Library for Arduino
GNU Lesser General Public License v2.1
30 stars 31 forks source link

Add FIFO, gyroscrope calibration support #14

Open kaiiorg opened 4 years ago

kaiiorg commented 4 years ago

I got a little carried away while I was working on this:

FIFO Support (Issue #5):

Added methods to allow enable, disable, and reset of FIFO control registers. Allows reading of FIFO length from status registers and read accelerometer/gyroscope data out of the FIFO output registers. At the current 104Hz setting for both the accelerometer/gyroscope, the FIFO fills up in about 5 seconds.

The fifoRead() method takes a 2D array that is currently set to be 6 floats wide and has to read from two registers (LSM6DS3_FIFO_STATUS3 and LSM6DS3_FIFO_STATUS4) to know what position in the current sample the next value in two registers (LSM6DS3_FIFO_DATA_OUT_L and LSM6DS3_FIFO_DATA_OUT_H) is supposed to be, then reads those registers to get the data. Any changes to the ODR of anything will probably break this.

Probably should look into some dynamic way of tracking what's supposed to go into the FIFO based on other register settings to help know what we're actually reading, but I'm not ready to stare that far into the abyss.

Addressing Issue #13:

Removes the code that mistakenly sets an invalid bit to 1. Added enum to allow selection of low pass, high pass, and slope filters (or none of those).

Addressing Issue #2:

Adds gyroscope calibration method along with set and get methods to persist and restore of those values. If the method isn't called, the gyroscope is read normally and not adjusted.

Other changes:

kaiiorg commented 4 years ago

Looks like the Compile Examples build check fails because it can't find the arduino:megaavr:uno2018 core:

Running command: /github/home/bin/arduino-cli core install arduino:megaavr:uno2018 
   Invalid argument passed: invalid item arduino:megaavr:uno2018
CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

LazaroFilm commented 3 years ago

Any updates on this?