2020-10-21 01:24 AM
Hi. I am evaluating the LSM303 and trying to get the device working as an Compass. I have the AN3192 application note to assist with calculating the heading, but doesn't seem to give me the correct results. The raw data coming back when facing north is x = -44, y = +1, z = -363. When facing East I get x = +45, y = +122, z = -300. With these figures I can't seem to achieve 0 degrees and 90. Please can you point me in the right direction.
2020-10-23 08:23 AM
Hi @PMerc.1 ,
There are differences in terms of sensitivity of both accelerometer and magnetometer.
Moreover, the registers for the offset cancellation for the magnetometer are different...
You can compare the tho datasheets, LSM303DLH and LSM303AGR.
Please note that the above-mentioned arduino file is named "LSM303DLHC eCompass implementation", so it is intended (optimized) to work with this sensor.
-Eleon