Product Introduction

HiTechnic NXT Compass Sensor for LEGO Mindstorms NXT
Introduction
The NXT Compass Sensor contains a digital magnetic
compass that measures the earth’s magnetic field and
calculates a heading angle. The Compass Sensor connects to
an NXT sensor port using a standard NXT wire and uses the
digital I2C communications protocol. The current heading is
calculated to the nearest 1° and refreshed 100 times per
second.
The Compass Sensor is housed in a standard Mindstorms
sensor housing to match the other Mindstorms elements.
To test your new sensor, plug it into port 2 of your NXT and select View > Ultrasonic cm > Port 2. As you
swing the sensor around, you’ll notice that the readings will change from 1 – 179. (0 will display as
?????? while in View mode.)
Programming
Mindstorms NXT-G
The compass can be programmed using LEGO Mindstorms NXT Software Compass Block*. If the
Compass Block is not available you may also use the standard Ultrasonic Block.
*Note: The NXT Compass Block can be downloaded by going to the Downloads page.
Ultrasonic Block
If using the Ultrasonic Block to program the compass, configure the block to centimeter mode as shown.
The Ultrasonic Block can only return values from 0 to 250 so in order to return the full range of headings,
0 to 360, the heading value returned when using the Ultrasonic Block will be the current heading divided
by 2. For example, if the current heading is 220°, the value returned will be 110. North will return a value

Summary of content (5 pages)