Library for MMA7660FC Accelerometer device

Dependents:   TestCode_MMA7660FC 3D_Accelerometer_Tester RTOS-aap-board-modules embed_Grove_3-Axis_Digital_Accelerometer ... more

Revision:
4:6e931d9bbf4b
Parent:
3:df25c72e16be
Child:
5:d2f90c0be13f
diff -r df25c72e16be -r 6e931d9bbf4b MMA7660FC.h
--- a/MMA7660FC.h	Tue Jul 03 18:37:19 2012 +0000
+++ b/MMA7660FC.h	Wed Jul 04 20:20:27 2012 +0000
@@ -42,10 +42,10 @@
  *      while(1)
  *      {
  *          int x=0, y=0, z=0;
- *          Acc.read_g(&x, &y, &z);
- *          pc.printf("x: \n", x);
- *          pc.printf("x: \n", y);
- *          pc.printf("x: \n", z);
+ *          Acc.read_Tilt(&x, &y, &z);
+ *          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(1);       
  *      }
  * }
@@ -74,13 +74,13 @@
         */
       void init();
     
-       /** Read the x,y,z axis acceleration and return a 6bit unsigned data
+       /** Read the Tilt Angle using Three Axis
         *
-        * @param *x Value of X acceleration
-        * @param *y Value of Y acceleration
-        * @param *z Value of Z acceleration
+        * @param *x Value of x tilt
+        * @param *y Value of y tilt
+        * @param *z Value of z tilt
         */
-      void read_g(int *x, int *y, int *z);
+      void read_Tilt(float *x, float *y, float *z);
       
       /** Read the x register of the MMA7660FC
         *
@@ -98,7 +98,7 @@
         *
         * @returns The value of z acceleration
         */
-      float read_z();
+       float read_z();
             
         /** Read from specified MMA7660FC register
          *