tim007 tim007
/
LV9-G6-T007-Z1
Haris Spahić Džafić Faris
main.cpp@0:cce03aa08048, 2014-05-15 (annotated)
- Committer:
- tim007
- Date:
- Thu May 15 14:31:15 2014 +0000
- Revision:
- 0:cce03aa08048
LV9-Grupa6-Tim007-Zadatak1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tim007 | 0:cce03aa08048 | 1 | #include "mbed.h" |
tim007 | 0:cce03aa08048 | 2 | #include "MMA8451Q.h" |
tim007 | 0:cce03aa08048 | 3 | #define MMA8451_I2C_ADDRESS (0x1d<<1) |
tim007 | 0:cce03aa08048 | 4 | |
tim007 | 0:cce03aa08048 | 5 | Serial pc(USBTX, USBRX); |
tim007 | 0:cce03aa08048 | 6 | |
tim007 | 0:cce03aa08048 | 7 | |
tim007 | 0:cce03aa08048 | 8 | |
tim007 | 0:cce03aa08048 | 9 | MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS); |
tim007 | 0:cce03aa08048 | 10 | Ticker t; |
tim007 | 0:cce03aa08048 | 11 | |
tim007 | 0:cce03aa08048 | 12 | void ispisi() |
tim007 | 0:cce03aa08048 | 13 | { |
tim007 | 0:cce03aa08048 | 14 | pc.printf("Koordinate X = %f; Y = %f; Z = %f\n",acc.getAccX(), acc.getAccY(), acc.getAccZ()); |
tim007 | 0:cce03aa08048 | 15 | } |
tim007 | 0:cce03aa08048 | 16 | |
tim007 | 0:cce03aa08048 | 17 | int main() |
tim007 | 0:cce03aa08048 | 18 | { |
tim007 | 0:cce03aa08048 | 19 | t.attach(ispisi,1); |
tim007 | 0:cce03aa08048 | 20 | while(1) |
tim007 | 0:cce03aa08048 | 21 | { |
tim007 | 0:cce03aa08048 | 22 | } |
tim007 | 0:cce03aa08048 | 23 | } |