NeoBirth / ADXL343.rs

Rust ADXL343 accelerometer driver which uses I²C via embedded-hal
Apache License 2.0
7 stars 8 forks source link

Add `invert_z_axis()` method #35

Closed tarcieri closed 4 years ago

tarcieri commented 4 years ago

The accelerometer v0.12 release inverted (actually corrected) how the orientation tracker handles the z-component reading when calculating an orientation.

It was wrong because it was based off the Trellis M4, which mounts the ADXL343 on the underside of the board.

This commit adds a convenient invert_z_axis() method to handle this scenario.

tarcieri commented 4 years ago

Will look at other ways of implementing this, including moving it into accelerometer::Tracker