Program blinks LED's from left to right (LED1 -> LED4) Then enters deep sleep. Will wake up when high signal sensed at pin 14.
Revision 0:36c6cc38abab, committed 2012-05-06
- Comitter:
- harrisjunaid
- Date:
- Sun May 06 14:42:27 2012 +0000
- Commit message:
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /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(); + } + +}