10
Dependencies: mbed C12832 MMA7660
Diff: main.cpp
- Revision:
- 5:636ebfdf373b
- Parent:
- 4:39c7c31b8fb0
- Child:
- 6:8b78adfc4faa
--- a/main.cpp Thu Feb 06 15:13:17 2014 +0000 +++ b/main.cpp Thu Feb 06 17:00:28 2014 +0000 @@ -1,20 +1,20 @@ #include "mbed.h" #include "C12832.h" +#include "MMA7660.h" // Using Arduino pin notation C12832 lcd(D11, D13, D12, D7, D10); +MMA7660 MMA(SDA,SCL); int main() { - int j=0; lcd.cls(); lcd.locate(0,3); lcd.printf("mbed application shield!"); - while(true) { // this is the third thread - lcd.locate(0,15); - lcd.printf("Counting : %d",j); - j++; - wait(1.0); + while(1) { + lcd.locate(0,14); + lcd.printf("x=%.2f y=%.2f z=%.2f",MMA.x(), MMA.y(), MMA.z()); + wait(0.2); } }