tim003 tim003
/
LV9_Grupa3_Tim003_Zad1
Adnan Kicin Repuh Sahin
main.cpp@0:150fd6d812b2, 2014-05-12 (annotated)
- Committer:
- tim003
- Date:
- Mon May 12 14:34:57 2014 +0000
- Revision:
- 0:150fd6d812b2
LV9_Grupa3_Tim003_Zad1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tim003 | 0:150fd6d812b2 | 1 | #include "mbed.h" |
tim003 | 0:150fd6d812b2 | 2 | #include "MMA8451Q.h" |
tim003 | 0:150fd6d812b2 | 3 | |
tim003 | 0:150fd6d812b2 | 4 | #define MMA8451_I2C_ADDRESS (0x1d<<1) |
tim003 | 0:150fd6d812b2 | 5 | MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS); |
tim003 | 0:150fd6d812b2 | 6 | |
tim003 | 0:150fd6d812b2 | 7 | Serial pc(USBTX, USBRX); |
tim003 | 0:150fd6d812b2 | 8 | |
tim003 | 0:150fd6d812b2 | 9 | int main() { |
tim003 | 0:150fd6d812b2 | 10 | while(1) { |
tim003 | 0:150fd6d812b2 | 11 | pc.printf("\nX-osa: %f Y-osa: %f Z-osa: %f", acc.getAccX(), acc.getAccY(), acc.getAccZ()); |
tim003 | 0:150fd6d812b2 | 12 | wait(1); |
tim003 | 0:150fd6d812b2 | 13 | } |
tim003 | 0:150fd6d812b2 | 14 | } |