Edoardo De Marchi
/
TestCode_MMA7660FC
Test Code for MMA7660FC device
Revision 2:152191e37eb1, committed 2012-07-05
- Comitter:
- edodm85
- Date:
- Thu Jul 05 17:48:44 2012 +0000
- Parent:
- 1:78138640bd0e
- Commit message:
- Rev 3
Changed in this revision
MMA7660FC.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 78138640bd0e -r 152191e37eb1 MMA7660FC.lib --- a/MMA7660FC.lib Wed Jul 04 20:22:15 2012 +0000 +++ b/MMA7660FC.lib Thu Jul 05 17:48:44 2012 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/edodm85/code/MMA7660FC/#6e931d9bbf4b +http://mbed.org/users/edodm85/code/MMA7660FC/#d2f90c0be13f
diff -r 78138640bd0e -r 152191e37eb1 main.cpp --- a/main.cpp Wed Jul 04 20:22:15 2012 +0000 +++ b/main.cpp Thu Jul 05 17:48:44 2012 +0000 @@ -26,16 +26,16 @@ { float x=0, y=0, z=0; - Acc.read_Tilt(&x, &y, &z); // Read the acceleration + Acc.read_Tilt(&x, &y, &z); // Read the acceleration pc.printf("Tilt x: %2.2f degree \n", x); // Print the tilt orientation of the X axis pc.printf("Tilt y: %2.2f degree \n", y); // Print the tilt orientation of the Y axis pc.printf("Tilt z: %2.2f degree \n", z); // Print the tilt orientation of the Z axis wait_ms(100); - pc.printf("x: %2.0f \n", Acc.read_z()); // Print the X axis acceleration - pc.printf("y: %2.0f \n", Acc.read_y()); // Print the Y axis acceleration - pc.printf("z: %2.0f \n", Acc.read_z()); // Print the Z axis acceleration + pc.printf("x: %1.3f g \n", G_VALUE[Acc.read_x()]); // Print the X axis acceleration + pc.printf("y: %1.3f g \n", G_VALUE[Acc.read_y()]); // Print the Y axis acceleration + pc.printf("z: %1.3f g \n", G_VALUE[Acc.read_z()]); // Print the Z axis acceleration pc.printf("\n"); wait(5);