-
Notifications
You must be signed in to change notification settings - Fork 14
Add offset and offset calibration example. #34
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
print("Raw z: ", z) | ||
|
||
accelerometer.offset = ( | ||
int(-(x + 4) / 8), |
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.
int(-(x + 4) / 8),
can be replaced with
round(-x / 8)
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.
@ladyada What was the + 4
in the Arduino code? Or did you mean replace only int()
with round()
and leave the rest?
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.
it does the rounding in C
use round(-x / 8)
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.
Ah ok, update incoming!
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x to 1.12.0 from 1.11.12: > Merge pull request adafruit/Adafruit_CircuitPython_ADXL34x#34 from kattni/offset Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL37x to 1.1.0 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_ADXL37x#2 from kattni/offset Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 5.1.6 from 5.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_BusDevice#84 from dhalbert/circuitpython_typing Updating https://github.com/adafruit/Adafruit_CircuitPython_Debug_I2C to 1.2.8 from 1.2.7: > Merge pull request adafruit/Adafruit_CircuitPython_Debug_I2C#12 from dhalbert/circuitpython-typing > Fixed readthedocs build
No description provided.