-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FIFO, gyroscrope calibration support #14
Conversation
…s suggested in issue #13. Added a quick and dirty sketch to allow easy compiling and testing of the library while developing.
…#13 changes the filter and the values read from the accelerometer. Leaving the register at the default value doesn't change the values read.
…the acceleration values? Getting some really weird values.
… the data out the Serial line. Still getting some really wacky numbers for the gryo. Still not sure how to fix that.
Looks like the
|
|
1 similar comment
|
Any updates on this? |
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
andLSM6DS3_FIFO_STATUS4
) to know what position in the current sample the next value in two registers (LSM6DS3_FIFO_DATA_OUT_L
andLSM6DS3_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:
begin()
because (in my experience) the reset button on the Nano IoT doesn't reset the chip!writeRegister()
call that was settingLSM6DS3_CTRL7_G
to0x00
, even though that's the default value of that register