Adna Duraković

Dependencies:   MMA8451Q mbed

Committer:
tim010
Date:
Mon May 12 16:36:19 2014 +0000
Revision:
0:a3ab69f8944c
PAI_LV9_Grupa4_Tim010

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tim010 0:a3ab69f8944c 1 #include "mbed.h"
tim010 0:a3ab69f8944c 2 #include "MMA8451Q.h"
tim010 0:a3ab69f8944c 3
tim010 0:a3ab69f8944c 4 #define MMA8451_I2C_ADDRESS (0x1d<<1)
tim010 0:a3ab69f8944c 5
tim010 0:a3ab69f8944c 6 Serial pc(USBTX, USBRX);
tim010 0:a3ab69f8944c 7 MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS);
tim010 0:a3ab69f8944c 8
tim010 0:a3ab69f8944c 9 int main()
tim010 0:a3ab69f8944c 10 {
tim010 0:a3ab69f8944c 11 while(1)
tim010 0:a3ab69f8944c 12 {
tim010 0:a3ab69f8944c 13 pc.printf("%.2f, %.2f, %.2f\n", acc.getAccX(), acc.getAccY(), acc.getAccZ());
tim010 0:a3ab69f8944c 14 wait(2);
tim010 0:a3ab69f8944c 15 }
tim010 0:a3ab69f8944c 16 }