This digital compass sensor has been specifically designed for Lego Mindstorms NXT by the company Hitechnic. This device is Lego certified. It measures the magnetic field of the earth, thus indicating the magnetic orientation of the robot, that’s to say an absolute orientation.
|All the HiTechnic sensors are
Lego Hardware Certified
This digital compass sensor performs 100 measures per seconds and returns a value between 0 and 359 degrees, representing the angle to the north. Two different modes are available on this sensor:
- In lecture mode, the sensor returns a value each time a read command is sent by the Lego Mindstorms NXT Intelligent Brick
- In calibration mode, the sensor can be configured to compensate for parasite magnetic field sources such as electric motors of the robot, batteries...
A relative or absolute lecture mode is available, making programs easier to achieve if one wants the robot to follow a particular direction
Programming the compass sensor using NXT-G
The digital compass sensor is programmable using NXT-G, as shown by the two pictures below:
Click on this link to download the source code of the NXT-G block for the compass sensor