SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By 0diosis

I've been trying to change the axis that the SparkFun_MAG3110_Breakout_Board_Arduino_Library uses for its readHeading function, but have been unable to get reasonable results.

I've been working under the assumption that the axes should be interchangeable, so I've just been shifting (x=y, y=z, z=x) but the values always only have a ~120 range.

It doesn't look like the math cares which axes it's utilizing. Am I wrong in my assumption? What could I be trying instead?
By jremington
It is essential to calibrate the magnetometer. They do not work "out of the box".

There are several approaches to calibration that range in effectiveness, from low to high. At the very minimum you need to center and scale the data from each axis independently. At best, you also apply off-axis rotations.

Here is an overview of the process: ... r-arduino/