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
MMA8452.lib@0:0c17274c3b7c, 2014-03-04 (annotated)
- Committer:
- ashleymills
- Date:
- Tue Mar 04 17:51:27 2014 +0000
- Revision:
- 0:0c17274c3b7c
- Child:
- 1:e9981919b524
(Incomplete) test program for the MMA8452 accelerometer
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 0:0c17274c3b7c | 1 | http://mbed.org/users/ashleymills/code/MMA8452/#172540ff6b8b |