views:

315

answers:

1

Does anyone know how to adjust the iPhone's compass reading to adjust if you use it in landscape mode? The heading is always taken from the top of the device, but a true reading should be available if recalculations are made with the accelerometer data.

+1  A: 

I find the best way is to offset the heading by the number of degrees of tilt of the X axis.

I.e. straight up (home button at bottom), offset is 0. Tilt 90 degrees to right, add 90 degrees etc.

This will give you the correct heading to within ~3 degrees

Source: I'm making an AR satellite tracking app for the iPhone 3GS currently.

Chaos