WebbotLib AVR library
WebbotLib It just does it
C++documentationCdocumentation

Compass

Supports compasses.
Remember that little magnetic gadget you had as kid? Yes - a compass measures a bearing in degrees. ie hold it flat and spin around and the bearing should change all the way from 0 through to 359 and then back to 0 when you are back in your start position.
Some devices provide additional information like 'roll' and 'pitch'. Roll is like twisting your hand when you are locking or unlocking a door, and 'pitch' is like raising or lowering your 'arm' - whereas 'bearing' is like twisting your body from side to side.
All readings from this library are in degrees but devices that don't support roll and pitch will return zero for those values.
These devices either use one ADC pin for each reading or provide an I2C interface. Project Designer will guide you as to what power supply they require.
Since all of the devices have been implemented in the same way then it means that you can swap one device for another in Project Designer and, so long as you keep the same name, then your project code wont need changing.

Project Designer supports the following devices

Valid XHTML 1.0 Transitional