deepsleep() program for mbed LPC11U24 beta

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 BusOut leds(LED1,LED2,LED3,LED4);
00004 
00005 InterruptIn wakeup(p14);
00006 
00007 void dostuff() {
00008     for (int i=0; i<5; i++) {
00009         leds = 1 << i;
00010         wait(0.25);
00011     }
00012 }
00013 
00014 int main () {
00015 
00016     wakeup.rise(NULL);
00017 
00018     while (1) {
00019         dostuff();
00020         deepsleep();
00021     }
00022 
00023 }