Skip to content

Commit

Permalink
Update calibration math.
Browse files Browse the repository at this point in the history
  • Loading branch information
kattni committed Feb 15, 2022
1 parent bca8770 commit f72c5e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/adxl34x_offset_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
print("Raw z: ", z)

accelerometer.offset = (
int(-(x + 4) / 8),
int(-(y + 4) / 8),
int(-(z - 250 + 4) / 8), # Z should be '250' at 1g (4mg per bit)
round(-x / 8),
round(-y / 8),
round(-(z - 250) / 8), # Z should be '250' at 1g (4mg per bit)
)
print("Calibrated offsets: ", accelerometer.offset)

Expand Down

0 comments on commit f72c5e0

Please sign in to comment.