SparkFun_MAG3110_Breakout_Board_Arduino_Library icon indicating copy to clipboard operation
SparkFun_MAG3110_Breakout_Board_Arduino_Library copied to clipboard

Getting extreme readings

Open mikevanis opened this issue 7 years ago • 3 comments

Hi @sparkfun,

I'm using this module with an ESP-12 and I'm just running the Basic example. I'm getting very unusual readings. Here is a typical sample:

X: 64895, Y: 425, Z: 64768

What could this be? Have I got a damaged MAG3110? Is there a weird scale value register set somewhere? Any clues would be much appreciated.

EDIT: Upon further investigation - the MAG3110 has two 8-bit registers for each axis. In this library, they're joined and packaged into an int. Shouldn't they be packed into a uint16_t or an unsigned int? Surely there's no sign in the values the magnetometer will spit out. Could I be getting these values due to an overflow?

mikevanis avatar Mar 15 '17 13:03 mikevanis