Mirembe Jean d'Amour / Mbed 2 deprecated P-edestrianButton

Dependencies:   mbed

Revision:
1:bc8b34ea89fb
Parent:
0:5391ae63bb4d
diff -r 5391ae63bb4d -r bc8b34ea89fb main.cpp
--- a/main.cpp	Fri Oct 30 13:59:11 2020 +0000
+++ b/main.cpp	Fri Oct 30 15:10:15 2020 +0000
@@ -4,9 +4,16 @@
 DigitalIn pedestrianButton(p6);
 
 int main() {
+    trafficYellowLight=1;
     while (1) {
         trafficYellowLight = !pedestrianButton;
-         //trafficYellowLight =  trafficYellowLight;
-         wait_ms(500);
+        
+    if (pedestrianButton){ //once button is set to ON
+    while(1){
+    trafficYellowLight =!trafficYellowLight;
+    wait(1);
     }
-}
+    }
+         wait_ms(50);
+    }
+}
\ No newline at end of file