Hmph, spent an afternoon debugging my Galaxy S3 Sensor app since it stopped working, checked all code changes for the last year then checked all the transformations etc. until I realized the compass sensor itself gave invalid values.
As a reminder to myself. Seems that you sometimes need to calibrate it:
- Phone
- *#0*#
- In the test menu press sensors
- Immediately start rotating the phone around all its axes until the little compass at the bottom of the screen shows 3.
- Then lay it flat on the table and check that it displays the correct values (comparing it with a real compass) while rotating it over 360°
- If not correct go back to the sensor menu and repeat from 3 onwards.