advanced "hello, world"

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jollen
Date:
Tue Jan 20 06:50:10 2015 +0000
Commit message:
advanced "Hello, World"

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	Tue Jan 20 06:50:10 2015 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
+
+unsigned int mask = 0x1;
+
+int main() {
+    wait(0.8);
+    
+    while(1) {    
+        myled1 = mask & 0x1;
+        myled2 = mask & 0x2;
+        myled3 = mask & 0x4;
+        myled4 = mask & 0x8;
+        
+        wait(0.2);
+        
+        mask = mask << 1;
+        
+        if (mask & 0x10) 
+            mask = 0x1;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jan 20 06:50:10 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file