Aida Pločo Tarik Demirović

Dependencies:   MMA8451Q mbed

Committer:
tim003
Date:
Mon May 12 07:39:30 2014 +0000
Revision:
0:799facdd5da1
LV9-PAI-Grupa1-Tim003-Zadatak1

Who changed what in which revision?

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