HMC5883L compass huge error [SOLVED]

You will want to implement some tilt compensation for the compass, using the accelerometer to figure roll, pitch and yaw.
Here's a library we (my friend and I) wrote: Loading...