Jenny Plunkett / Mbed 2 deprecated LED_bar_Simon_Says

Dependencies:   LED_Bar mbed

Files at this revision

API Documentation at this revision

Comitter:
jplunkett
Date:
Wed Aug 17 01:46:59 2016 +0000
Child:
1:1aca092ceb7e
Commit message:
init

Changed in this revision

LED_Bar.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
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/LED_Bar.lib	Wed Aug 17 01:46:59 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/Seeed/code/LED_Bar/#edcb13b58b4f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 17 01:46:59 2016 +0000
@@ -0,0 +1,52 @@
+#include "mbed.h"
+#include "LED_Bar.h"
+
+LED_Bar bar(D6, D5);
+DigitalIn button1(A3);
+DigitalIn button2(A2);
+DigitalIn button3(A1);
+DigitalIn button4(A0);
+int button_index;
+
+int main() {
+    bar.setLevel(0);
+    while(1) {
+        wait(0.3);
+        if (button1) { 
+            button_index = 1;
+            while(button1){
+                bar.setSingleLed(9, 1); 
+                bar.setSingleLed(8, 1);
+            }; 
+            bar.setSingleLed(9, 0); 
+            bar.setSingleLed(8, 0);
+        }
+        if (button2) { 
+            button_index = 2;
+            while(button2){
+                bar.setSingleLed(7, 1); 
+                bar.setSingleLed(6, 1);
+            }; 
+            bar.setSingleLed(7, 0); 
+            bar.setSingleLed(6, 0);
+        }
+        if (button3) { 
+            button_index = 3;
+            while(button3){
+                bar.setSingleLed(5, 1); 
+                bar.setSingleLed(4, 1);
+            }; 
+            bar.setSingleLed(5, 0); 
+            bar.setSingleLed(4, 0);
+        }
+        if (button4) { 
+            button_index = 4;
+            while(button4){
+                bar.setSingleLed(3, 1); 
+                bar.setSingleLed(2, 1);
+            }; 
+            bar.setSingleLed(3, 0); 
+            bar.setSingleLed(2, 0);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Aug 17 01:46:59 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b0220dba8be7
\ No newline at end of file