-
Notifications
You must be signed in to change notification settings - Fork 20
change from dps->rads for gyro to fix #9 #14
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
Conversation
adafruit_lsm6ds.py
Outdated
x = self._scale_gyro_data(raw_gyro_data[0]) | ||
y = self._scale_gyro_data(raw_gyro_data[1]) | ||
z = self._scale_gyro_data(raw_gyro_data[2]) | ||
x = self._scale_gyro_data(raw_gyro_data[0]) * _DPS_TO_RADS |
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.
You could use math.radians(self._scale_gyro_data....)
instead, and lose the _DPS_TO_RADS constant. math.radians() is standard in Python and I checked for its presence in CircuitPython.
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.
@siddacious try a x, y, z = [math.radians(self._scale_gyro_data(i)) for in raw_gyro_data]
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.
👍
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 for making the requested change.
Updating https://github.com/adafruit/Adafruit_CircuitPython_AM2320 to 1.2.2 from 1.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_AM2320#16 from jerryneedell/jerryn_revert_pr_9 Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL to 2.1.3 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_LIS2MDL#5 from FoamyGuy/master Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 2.1.3 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#14 from adafruit/rads_fix > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#13 from adafruit/pylint-update Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 6.1.3 from 6.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#80 from dhalbert/initial-value-none
I neglected to convert to radians/sec when I first wrote the lib, so here's a fix!
Thanks to @kevinjwalters for reporting the issue