Program blinks LED's from left to right (LED1 -> LED4) Then enters deep sleep. Will wake up when high signal sensed at pin 14.
Diff: main.cpp
- Revision:
- 0:36c6cc38abab
diff -r 000000000000 -r 36c6cc38abab main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 06 14:42:27 2012 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +BusOut leds(LED1,LED2,LED3,LED4); + +InterruptIn wakeup(p14); + +void dostuff() { + for (int i=0; i<5; i++) { + leds = 1 << i; + wait(0.25); + } +} + +int main () { + + wakeup.rise(NULL); + + while (1) { + dostuff(); + deepsleep(); + } + +}