To get useful direction readings, you must hold the magnetometer level, with the Z axis vertical. The magnetometer must also be calibrated, or it won't work at all. Adafruit has a calibration tutorial.
To get useful direction readings, you must hold the magnetometer level, with the Z axis vertical. The magnetometer must also be calibrated, or it won't work at all. Adafruit has a calibration tutorial.