32U4 Inertial Sensors(Compass)

I was using the 32U4’s Intertial sensor test(ultimately to test the compass) and it seemed to work fine. The X values for the magnetometer would change as I spun the robot as one would expect. Now when I put in the min and max calibration, and checked the heading, it would give me garbage values. Occasionally it would increase as I spun but usually it wouldn’t even do that. When I checked the last_status variable It was equal to zero meaning there was no error when doing wire.endTransmission(). I also took out the batteries to make sure that the motors or the batteries weren’t interfering. I even spun the robot around to make sure that the I wasn’t using the wrong direction of the PCB.

Hello.

I am sorry you are having trouble with your magnetometer. Did you make sure to point the Zumo32U4 in every orientation while the calibration routine was running? (Imagine your hand is surrounded by a sphere and that the Zumo32U4 is a paint brush. If you properly calibrated, you would have effectively painted the entire inside of the sphere.)

If you have already verified that you are calibrating effectively, could you post an example of the raw magnetometer output? Also, what calibration values were you using?

-Jon