adafruit / Adafruit_HMC5883_Unified

48 stars 35 forks source link

Incorrect Z scale factor on +/- 4.7G range #8

Open groundstate opened 3 years ago

groundstate commented 3 years ago

In Adafruit_HMC5883_Unified::setMagGain() the Z scale factor for the +/- 4.7 G range is set as 255 This seems to be a typo - it should be something like 355

This also brings up the question of why XY and Z axes have different scale factors. The data sheet says nothing about this and the scale factors in the data sheet are not the same as in the code. Has the author of the code done their own calibration ? Or is the code for an earlier version of the chip?