Dann schau mal hier:

http://home.arcor.de/uffmann/ARTIST3.htm

"Calculating Tilt Angle from 2-Axis Accelerometer Data

Bild hier  

Then the forward (or backward) acceleration a of the robot can be calculated to:

a= +- SquareRoot( Square(x) + Square(y) - 1)

+ for the case a>0

- for the case a<0

and

tilt=arcsin((x-y*a)/(Square(x)+Square(y)))

# for the case a>0

tilt=arcsin((x+y*a)/(Square(x)+Square(y)))

# for the case a<0

tilt=arcsin(x)

# for the case a=0

All values are normalized to the earth's acceleration g (g=1).

The remaining unknown figure is the sign or direction of the acceleration a to get the correct result for the tilt. This could be derived from the motor control comparing the motor power during the last two control steps before this measurement.

When adapting these formulas for the tilt angle from accelerometer data, please care for the fact, that the accelerometers have different sign for dynamic and static acceleration. This fact is not yet considered in the above mentioned formulas. So the sign of the acceleration "a" must be inverted for the real measurements. "