Skip to content

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

Merged
merged 3 commits into from
Feb 16, 2022
Merged

Conversation

kattni
Copy link
Contributor

@kattni kattni commented Feb 15, 2022

No description provided.

@kattni kattni requested a review from a team February 15, 2022 21:04
print("Raw z: ", z)

accelerometer.offset = (
int(-(x + 4) / 8),
Copy link
Member

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)

Copy link
Contributor Author

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?

Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, update incoming!

@tekktrik tekktrik merged commit 33228e3 into adafruit:main Feb 16, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 17, 2022
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
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

Successfully merging this pull request may close these issues.

3 participants