MMA8452Q Accelerometer - Measure Angle & Acceleration

Hi all,

I have the MMA8452Q Accelerometer, it's working! (Used this link: https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide)

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: http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8452Q.pdf?fpsp=1 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.