Digital Compass (PWM)

The digital compass has two options for interfacing it (I2C, PWM). We tried PWM input capure becasue it seemed like the easier option. Becasue the clock restarts at 40 it took a bit to figure out how to get a reading in degrees from the pulse width capture reading. I got eventually... However, the readings were not really accurate and the values liked to spike sometime for no apperant reason. Since the I2C pins were not being used by anything else so we decided it would be the best option.