I am interfacing the Memsic 2125 accelerometer to the Arduino Pro Mini 5 V. I need to distinguish between the accelerometer being in the upright position and being upside down. As I rotated the accelerometer 180 degrees, the PulseIn values increased but then decreased back to the original upright value. I don't understand why this is happening and if it is right.
This is the x-axis output as I rotated it 180 degrees along the axis:
4972 //upright position
4976
5260
5531
5691
5864
6149
6208
6175
6134
6011
5885
5729
5608
5482
5402
5252
5087
4979
4972 //upside down
If this seems right, how can I distinguish between the accelerometer being upright and upside down?
Thank you.