Windows Phone 7 Accelerometer Values


I’ve been playing with the accelerometer in Windows Phone 7 and trying to make sense of the outputs. If you are interested (and, I guess if you are not) these are the values for the different orientations:

Flat on the desk: X=0, Y=0, Z=-1
Upside down on the desk:X=0, Y=0, Z=1
Standing like a tombstone: X=0,Y=-1, Z=0
Standing like an upside down tombstone: X=0,Y=1,Z=0
Landscape – controls on right: X=-1,Y=0,Z=0
Landscape – controls on left: X=1,Y=0,Z=0

The best way to visualise this is as a weight on a piece of string of unit length tied to the phone. If you hold the phone flat in portrait mode the the weight hangs straight down, giving X=0, Y=0 and Z=-1. Then as you tip the phone up to make it into a tombstone (as it were) the weight moves so that it is hanging directly below the phone, giving a Y of -1 and a Z of 0 and so on.

Apparently these values will be the same irrespective of how the program sets the orientation of the phone, i.e. they are set to give values as if you were using the phone in portrait mode. If you want to use different orientations you will have to transform these values.

I’ve found the readings to be quite accurate, at least as good as my real spirit level.