Example program with the color LEDs of the mbed application shield

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
screamer
Date:
Mon Mar 17 18:56:15 2014 +0000
Child:
1:2845fe4324a0
Commit message:
Initial revision

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld 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	Mon Mar 17 18:56:15 2014 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+ 
+DigitalOut led(LED1);
+DigitalOut red(D5);
+DigitalOut blue(D8);
+DigitalOut green(D9);
+int i;
+ 
+int main()
+{ 
+    while(1) {
+        for (i=1; i<7; i++) {
+            green = i & 1;
+            blue = i & 2;
+            red = i & 4;
+            led = led ? 0 : 1;
+            wait(0.2);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 17 18:56:15 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file