Sarthak Gadre
/
lab6_AcceloPlotter
Plot of accelerometers axis
Diff: main.cpp
- Revision:
- 0:a0321e9eb2d8
--- /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