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

Devantech CMPS09 Compass

The CMPS09 compass sensor with roll and pitch.
CMPS09_I2C.jpg
The compass is connected via the I2C bus and also requires a 3.3V or 5V regulated supply.
The default I2C address is 0xC0. Project Designer also list the other potential addresses that can be used but you need to read the data sheet to find out how to modify the device to use one of these alternate addresses.
You may also need to calibrate the compass depending upon where you are on the earth and this is also explained in the data sheet.
Function Summary

Valid XHTML 1.0 Transitional