mied_led

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
markilgerl
Date:
Thu Apr 28 15:26:20 2016 +0000
Commit message:
fdefqe

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	Thu Apr 28 15:26:20 2016 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+
+BusOut lb(P1_13, P1_12, P1_7, P1_6, P1_4, P1_3, P1_1, P1_0, LED4, LED3, LED2, LED1);
+//         D20    D19    D18   D17   D16   D15    D14  D13   D4    D3   D2     D1
+
+void LedBarTest();
+void RunLight1();
+void RunLight2();
+
+int main() {
+  while(1){
+    RunLight2();    
+  }
+}
+
+void LedBarTest(){
+  lb = 1;
+  wait_ms(500);
+  lb = 2;
+  wait_ms(500);
+  lb = 4;
+  wait_ms(500);
+  lb = 2048;
+  wait_ms(500);
+}
+
+void RunLight1(){
+  lb = 1;
+  wait_ms(100);
+  for(int i = 0; i<=12; i++){
+    lb = lb << 1;
+    wait_ms(100);
+  }    
+}
+
+void RunLight2(){
+  lb = 0;
+  wait_ms(100);
+  
+  for (int x = 0; x<=2; x++){
+    wait_ms(100);
+    lb = (lb << 1) | 1;
+  } 
+  for(int i = 0; i<=11; i++){
+      wait_ms(100);
+      lb = lb << 1;
+  } 
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 28 15:26:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68
\ No newline at end of file