This sensor is a digital magnetic compass that measures the Earth's magnetic field to find the position of the Earth's magnetic poles. This sensor outputs a value from 0 to 359 degrees, which indicates the sensor's current absolute heading (the angle that the sensor faces) based off of magnetic north. A heading value of 0 degrees means that the sensor is facing due north; 90 degrees indicates that the sensor is facing east, 180 degrees is south, and 270 degrees is west:
The sensor also has a relative heading feature, which allows the user to set a target heading. The target heading becomes the new zero position. Relative ...