adafruit/Adafruit_HMC5883_Unified

Incorrect Z scale factor on +/- 4.7G range

groundstate opened this issue · 0 comments

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?