Plot of accelerometers axis

Dependencies:   MMA8451Q mbed

Revision:
0:a0321e9eb2d8
diff -r 000000000000 -r a0321e9eb2d8 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Dec 03 11:18:16 2016 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+
+#include"MMA8451Q.h"
+#define MMA8451_I2C_ADDRESS (0x1d<<1)
+Serial pc(USBTX,USBRX);//tx,rx
+
+int main()
+{
+    int x=0;
+    int y=0;
+    int z=0;
+    MMA8451Q acc(PTE25,PTE24,MMA8451_I2C_ADDRESS);
+    
+    while(1)
+    {
+        x=1000*acc.getAccY();
+        y=1000*acc.getAccX();
+        z=1000*acc.getAccZ();
+        
+        pc.printf("$%d %d %d;",x,y,z);
+        wait(0.1);
+        }
+        }
\ No newline at end of file