Skip to content

Sample rate for accelerometer? #26

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

Open
maha-haji opened this issue Dec 2, 2020 · 3 comments
Open

Sample rate for accelerometer? #26

maha-haji opened this issue Dec 2, 2020 · 3 comments

Comments

@maha-haji
Copy link

Hi,

Is it possible to set the sample rate for the accelerometer? In the Arduino library there is a setting that can be altered, but I don't see the same in this library.

Thanks!

@caternuson
Copy link
Contributor

Reopening for further discussion. There are some additional features here that do not appear to be currently implemented. Others have requested these also. If there's a reason for not doing this, like making the library too big or something, then let's document it here at least.

@caternuson caternuson reopened this Feb 15, 2021
@lucasgaley
Copy link

Hello,

From the datasheet, it appears to me that in adafruit_lsm9ds1.py#L152, the gyroscope is set to continuous mode. In that same write, it looks as though the datarate is set to 952 hz (0xC0 or 11000000). If the first three parts of that binary string had an option selection like the acceleration ranges in L#166-191, that would be very beneficial.

Additionally, the magnetometer datarate appears to never be set. From the datasheet, the continuous mode does not set a datarate for the magnetometer, and it's default datarate appears to be 10 hz. The key register would be REG1_M, which is already defined. I can do some work on this (mostly copying the user facing code for the ranges, and hopefully adapting them for the frequencies), but my unfamiliarity would require some oversight to make sure that what I propose makes sense.

@lucasgaley
Copy link

In response to this, I have added all the code that I think would be necessary. I haven't had a chance to test things yet, and I'm not even sure what level of tests would be necessary. Please see below for "my" version.

https://github.com/lucasgaley/Adafruit_CircuitPython_LSM9DS1/blob/master/adafruit_lsm9ds1.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants