deepsleep() program for mbed LPC11U24 beta

Committer:
chris
Date:
Fri Oct 21 22:54:52 2011 +0000
Revision:
1:5ef4805c9afd
Parent:
0:1e4c251b7f9d

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chris 0:1e4c251b7f9d 1 #include "mbed.h"
chris 0:1e4c251b7f9d 2
chris 0:1e4c251b7f9d 3 BusOut leds(LED1,LED2,LED3,LED4);
chris 0:1e4c251b7f9d 4
chris 0:1e4c251b7f9d 5 InterruptIn wakeup(p14);
chris 0:1e4c251b7f9d 6
chris 0:1e4c251b7f9d 7 void dostuff() {
chris 0:1e4c251b7f9d 8 for (int i=0; i<5; i++) {
chris 0:1e4c251b7f9d 9 leds = 1 << i;
chris 0:1e4c251b7f9d 10 wait(0.25);
chris 0:1e4c251b7f9d 11 }
chris 0:1e4c251b7f9d 12 }
chris 0:1e4c251b7f9d 13
chris 0:1e4c251b7f9d 14 int main () {
chris 0:1e4c251b7f9d 15
chris 0:1e4c251b7f9d 16 wakeup.rise(NULL);
chris 0:1e4c251b7f9d 17
chris 0:1e4c251b7f9d 18 while (1) {
chris 0:1e4c251b7f9d 19 dostuff();
chris 0:1e4c251b7f9d 20 deepsleep();
chris 0:1e4c251b7f9d 21 }
chris 0:1e4c251b7f9d 22
chris 0:1e4c251b7f9d 23 }