![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Granulo Eldar Fahrudin Brbutović
Dependencies: MMA8451Q mbed sMotor
main.cpp@0:19a04545e304, 2014-05-12 (annotated)
- Committer:
- tim003
- Date:
- Mon May 12 09:55:57 2014 +0000
- Revision:
- 0:19a04545e304
LV9-PAI-Grupa2-Tim003-Zadatak1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tim003 | 0:19a04545e304 | 1 | #include "mbed.h" |
tim003 | 0:19a04545e304 | 2 | #include "MMA8451Q.h" |
tim003 | 0:19a04545e304 | 3 | |
tim003 | 0:19a04545e304 | 4 | #define ADDRESS (0x1d<<1) |
tim003 | 0:19a04545e304 | 5 | |
tim003 | 0:19a04545e304 | 6 | #define SDA PTE25 |
tim003 | 0:19a04545e304 | 7 | #define SCL PTE24 |
tim003 | 0:19a04545e304 | 8 | |
tim003 | 0:19a04545e304 | 9 | Serial pc(USBTX, USBRX); |
tim003 | 0:19a04545e304 | 10 | |
tim003 | 0:19a04545e304 | 11 | MMA8451Q acc(SDA, SCL, ADDRESS); |
tim003 | 0:19a04545e304 | 12 | |
tim003 | 0:19a04545e304 | 13 | int main() { |
tim003 | 0:19a04545e304 | 14 | while(1) { |
tim003 | 0:19a04545e304 | 15 | |
tim003 | 0:19a04545e304 | 16 | pc.printf("Po x osi: %lf, Po y osi: %lf, Po z osi: %lf \n", acc.getAccX(), acc.getAccY(), acc.getAccZ()); |
tim003 | 0:19a04545e304 | 17 | wait(1); |
tim003 | 0:19a04545e304 | 18 | } |
tim003 | 0:19a04545e304 | 19 | } |