sensing rotation with Adafruit MMA8451


I have an Adafruit MMA8451 accelerometer. I have it working to sense acceleration in each axis, but I want to be able to sense rotation so my project can always know which way is down.

Is this possible? If not, can anyone recommend the kind of sensor I need for this?


The accelerometer, when sitting still, reports 1 g acceleration due to the Earth's gravity.

This is handy for calibrating the sensor, and for determining the sensor orientation. The vector sum of the values on the 3 axes determines the "down" direction, unless other forces act to produce additional acceleration.

This link shows you how to use the accelerometer to measure tilt angles.