Projekte_werkstatt
/
p29_accelometer
adsfawre
Fork of MMA7660_HelloWorld by
Diff: main.cpp
- Revision:
- 0:bd0546063b0a
- Child:
- 3:f23f1ba7aeaa
diff -r 000000000000 -r bd0546063b0a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 17 16:40:45 2012 +0000 @@ -0,0 +1,21 @@ +//Uses the measured z-acceleration to drive leds 2 and 3 of the mbed + +#include "mbed.h" +#include "MMA7660.h" + +MMA7660 MMA(p28, p27); + +DigitalOut connectionLed(LED1); +PwmOut Zaxis_p(LED2); +PwmOut Zaxis_n(LED3); + +int main() { + if (MMA.testConnection()) + connectionLed = 1; + + while(1) { + Zaxis_p = MMA.z(); + Zaxis_n = -MMA.z(); + } + +}