tilt compensate a compass

google "sparkfun razor" and check out the example code they provide. it works like a charm. i assume you can modify it to fit your hardware setup.

p.