Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- 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