mobile acceleration/rotation

Ben Rubinstein benr_mc at
Wed Jan 13 08:07:36 EST 2016

Hmmmm - I've just tried reading the acceleration and rotation sensors.  I 
admit to finding the whole business confusing, but it seems to me that the 
data accompanying the accelerationChanged message represents the static 
orientation of the device.

At first I thought that the "rotation" and "acceleration" had been swapped - 
but then I realised it wasn't "rotation" but "rotation rate".

At any rate, the readings I'm getting for acceleration, with my phone lying 
flat on the desk, have x and y approximately 0, and z at -1.  If I bring the 
phone upright on its short end, y shifts to -1 and z to 0.  If instead I bring 
it upright to lie on its left edge, x goes to -1 and y and z to 0; if I bring 
it upright on the right edge, x goes to 1, y and z to 0.

These seem perfectly reasonable things to me, i.e. they seem to represent the 
state of rotation around the various axes; but I don't understand how they 
relate to acceleration.

Can someone explain this to me?

Many thanks,


More information about the Use-livecode mailing list