sleep() program for mbed NXP LPC11U24 beta

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Thu Oct 20 11:36:11 2011 +0000
Child:
1:61c2a1be2fac
Commit message:

Changed in this revision

2011_10_19.lib Show annotated file Show diff for this revision Revisions of this file
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/2011_10_19.lib	Thu Oct 20 11:36:11 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/projects/mbed-libraries/svn/branches/emilmont/2011_10_19@161
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 20 11:36:11 2011 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+
+BusOut leds(LED1,LED2,LED3,LED4);
+
+Ticker wakeup;
+
+void dostuff() {
+    for (int i=0; i<5; i++) {
+        leds = 1 << i;
+        wait(0.25);
+    }
+}
+
+int main () {
+
+    wakeup.attach(NULL, 3.0);
+
+    while (1) {
+        dostuff();
+        sleep();
+    }
+
+}