Plot of accelerometers axis

Dependencies:   MMA8451Q mbed

Files at this revision

API Documentation at this revision

Comitter:
sarthakgadre
Date:
Sat Dec 03 11:18:16 2016 +0000
Commit message:
Plot of accelerometer

Changed in this revision

MMA8451Q.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MMA8451Q.lib	Sat Dec 03 11:18:16 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/emilmont/code/MMA8451Q/#c4d879a39775
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Dec 03 11:18:16 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file