-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added support for setting data rate #19
Conversation
Solves #12 |
I wouldn't encourage use of |
@tannewt Ok, I'll give that a go |
@tannewt Ok, I allowed you to set the data rate when initializing it. I decided not to add a function to do that after initialization since the range was being set upon initialization as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple things. Good overall!
adafruit_l3gd20.py
Outdated
# self.write_register(_L3GD20_REGISTER_CTRL_REG1, 0x0F) | ||
self.write_register(_L3GD20_REGISTER_CTRL_REG1, rate + 0x0F) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# self.write_register(_L3GD20_REGISTER_CTRL_REG1, 0x0F) | |
self.write_register(_L3GD20_REGISTER_CTRL_REG1, rate + 0x0F) | |
self.write_register(_L3GD20_REGISTER_CTRL_REG1, rate | 0x0F) |
adafruit_l3gd20.py
Outdated
spi_busio, | ||
cs, | ||
rng=L3DS20_RANGE_250DPS, | ||
rate=L3DS20_RATE_100HZ, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add rate after baudrate to prevent breaking code that relies on position of these args. It wouldn't matter if there was a *,
before the kwargs to make them kwarg-only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! One more spot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you!
Updating https://github.com/adafruit/Adafruit_CircuitPython_BH1750 to 1.0.1 from 1.0.0: > Update README.rst Updating https://github.com/adafruit/Adafruit_CircuitPython_L3GD20 to 2.3.0 from 2.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_L3GD20#19 from dherrada/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.7.6 from 2.7.5: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#57 from FoamyGuy/fix_anchor_when_text_is_scaled
Tested with a feather M0 running CircuitPython 5.3.0