eldruin / lsm303agr-rs

Platform agnostic Rust driver for the LSM303AGR ultra-compact high-performance eCompass module: ultra-low-power 3D accelerometer and 3D magnetometer
Apache License 2.0
18 stars 14 forks source link

doc: The magnetometer values are in nT not mG #8

Closed hargoniX closed 2 years ago

hargoniX commented 2 years ago

commit be8451e723c0021e53d7eb7160ed534bd1abe1a1 introduced the scaling factor of 150 from the microbit codal by lancaster university. This factor is however explicitly mentioned to be a conversion factor to SI units here: https://github.com/lancaster-university/microbit-dal/blob/master/inc/drivers/LSM303Magnetometer.h#L36

With Tesla being the SI unit for magnetic field strength and the documentatoin of the dal also declaring the output values as being nanoteslas it is likely that this means this converts the magnetometer raw data to nanoteslas (This is also the only way the values im measuring with my lsm303agr are explainable).

robyoung commented 2 years ago

😬 sorry if I wasted a lot of your time @hargoniX. I really struggled with figuring out what the 150 was all about when I looked.