Anesa Drakovac Emir Mujačić

Dependencies:   MMA8451Q mbed

Committer:
tim007
Date:
Thu May 15 12:20:18 2014 +0000
Revision:
0:6427c1b90439
Anesa Drakovac; Emir Muja?i?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tim007 0:6427c1b90439 1 #include "mbed.h"
tim007 0:6427c1b90439 2 #include "MMA8451Q.h"
tim007 0:6427c1b90439 3
tim007 0:6427c1b90439 4 Serial pc(USBTX, USBRX);
tim007 0:6427c1b90439 5
tim007 0:6427c1b90439 6 #define MMA8451_I2C_ADDRESS (0x1d<<1)
tim007 0:6427c1b90439 7
tim007 0:6427c1b90439 8 MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS);
tim007 0:6427c1b90439 9 Ticker t;
tim007 0:6427c1b90439 10
tim007 0:6427c1b90439 11 void ispisi()
tim007 0:6427c1b90439 12 {
tim007 0:6427c1b90439 13 pc.printf("Koordinate X = %f; Y = %f; Z = %f\n",acc.getAccX(), acc.getAccY(), acc.getAccZ());
tim007 0:6427c1b90439 14 }
tim007 0:6427c1b90439 15
tim007 0:6427c1b90439 16 int main()
tim007 0:6427c1b90439 17 {
tim007 0:6427c1b90439 18 t.attach(ispisi,1);
tim007 0:6427c1b90439 19 while(1)
tim007 0:6427c1b90439 20 {
tim007 0:6427c1b90439 21 }
tim007 0:6427c1b90439 22 }