Implement this in the loop() function):
Read the X, Y, and X components of gravitational acceleration using the function DEVBOARD_readAccelerometer
Examine the Z-value of gravitational acceleration. If it is less than 7000 then illuminate the red LED
Display the X, Y and Z-components of gravitational acceleration on the LCD screen in the following format
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 A C C D A T A : X : x x x x x
1 Y : y y y y y Z : z z z z z
The value of the Y component of acceleration will be displayed from position (2, 1) The value of the Z component of acceleration will be displayed from position (10, 1) • Wait 300ms.
Comments
Leave a comment