MMA8452Q Accelerometer - Measure Angle & Acceleration

Hi all,

I have the MMA8452Q Accelerometer, it's working! (Used this link:

What i want to achieve: I need to put on rails, that are in an angle and the device needs to say if it reaches the end. Now my question was; - How do I measure the acceleration (pref in m/s^2) of the device? - How do I measure the angle that the device is in?

Thanks for the help.

btw i'm using a nano

study datasheet: The chip will tell you acceleration in three directions. Use vector addition to find total acceleration.

the device needs to say if it reaches the end

How do you imagine this to work? The accelerometer will always read acceleration due to gravity, even if it is not being accelerated by other forces.

Usually one would use a microswitch or photointerruptor to signal a fixed position.

Of course it will measure total acceleration.