For a few days now, we have been struggling with some strange behavior on the compass. We have isolated at least one cause of the problem (hopefully, this is the sole cause).
Normally, when the compass is rotated clockwise the values increase. But after we power down the Arduino (e.g., pull out the USB cable, hit the Arduino reset button, or power the attached robot off), if we don’t wait a few seconds, we get the opposite effect and the values decrease when we rotate the compass clockwise. In addition, the readings seem more erratic and generally less trustworthy. It’s hard to know how long we have to wait to avoid having the problem. We have counted to five before powering up and have still had the problem.
Two questions… 1) we are curious as what causes this and 2) is there a workaround?