hello.
I use the X-axis and Y-axis data obtained from the BMM150 to do the following
Compass = atan2f (mag_mx, mag_my);
if (compass < 0)
{
compass+= 2 * PI;
}
if (compass > 2 * PI)
{
compass-= 2 * PI;
}
TCompass = compass * 180 / PI;
When the X-axis points north, I get zero degrees, and I can rotate it to get an Angle from 0 to 360
But as I move horizontally north, my Angle slowly increases. Is that normal?
What causes it?
What do I need to fix this?