TinyWATCH-S3 / Official-firmware

Official firmware for Unexpected Maker's TinyWATCH S3
GNU General Public License v3.0
16 stars 7 forks source link

Add compass calibration and tilt compensation #45

Closed tetraDB closed 6 months ago

tetraDB commented 6 months ago

This modifies the core IMU class to enable functionality for in-watch hard iron calibration, including a more basic, but hopefully adequate soft iron calibration method. The calibration can be stored in flash and is currently done via the compass app.

The tilt compensation is integreated into the get_yaw() method, and has an input parameter that lets you skip the tilt compensation result. There is a new method called get_magnetic() that expects three float pointers for x, y and z magnetic reading, including a bool that lets you skip hard and soft iron calibration.

The compass app has been modified to perform fewer sin cos calulations, and has some basic UI to facilitate performing and storing magnetometer calibration.