The main.cpp program below demonstrates a simple way to interface with the MMA8452 accelerometer. The function reads in the acceleration data in the X, Y, and Z directions and displays them through a serial com port on a PC. The Putty Output figure below shows the output of the accelerometer using Putty. The program also dims or brightens the mbed LEDs 1-3 based on whether or not they are at 'level'( 0 Gs) or above respectively. The video below previews the code in action.
Fork of MMA8452_Test by
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
8:46eab8a51f91 | 2014-10-17 | Ivannrush | Hello World |
7:9b644d1c1405 | 2014-03-07 | ashleymills | Updated child. |
6:e3100f66ed6a | 2014-03-07 | ashleymills | Updated child and cleaned things up. |
5:756f9b157319 | 2014-03-06 | ashleymills | Adding independent query tests |
4:936b60956489 | 2014-03-05 | ashleymills | Updated child |
3:2a8e59a590db | 2014-03-05 | ashleymills | Updated child, cleaned something. |
2:0630128bdb32 | 2014-03-05 | ashleymills | Updated child. |
1:e9981919b524 | 2014-03-05 | ashleymills | Tests two's complement conversions and has gravity outputs. |
0:0c17274c3b7c | 2014-03-04 | ashleymills | (Incomplete) test program for the MMA8452 accelerometer |