Night Rider (LED Array)

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
micono
Date:
Sat Jul 12 05:55:51 2014 +0000
Commit message:
Night Rider (LED Array)

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
diff -r 000000000000 -r 111508c76839 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jul 12 05:55:51 2014 +0000
@@ -0,0 +1,52 @@
+#include "mbed.h"
+
+DigitalOut myled[]={LED1,LED2,LED3,LED4};
+/*DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
+*/
+
+int main() {
+    while(1) {
+        for(int i=0;i<4;i++) {
+            myled[i]=1;
+            wait(0.1);
+            myled[i]=0;
+        }
+        for(int i=2;i>0;i--) {
+            myled[i]=1;
+            wait(0.1);
+            myled[i]=0;
+        }
+        
+        /* 
+        myled1 = 1;
+        wait(0.05);
+        myled1 = 0;
+        wait(0.05);
+        myled2 = 1;
+        wait(0.05);
+        myled2 = 0;
+        wait(0.05);
+        myled3 = 1;
+        wait(0.05);
+        myled3 = 0;
+        wait(0.05);
+        myled4 = 1;
+        wait(0.05);
+        myled4 = 0;
+       wait(0.05);
+       
+        myled3 = 1;
+        wait(0.05);
+        myled3 = 0;
+        wait(0.05);
+        myled2 = 1;
+        wait(0.05);
+        myled2 = 0;
+        wait(0.05);
+*/
+       
+    }
+}
diff -r 000000000000 -r 111508c76839 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jul 12 05:55:51 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file