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.
Revision 1:bc8b34ea89fb, committed 2020-10-30
- Comitter:
- titig
- Date:
- Fri Oct 30 15:10:15 2020 +0000
- Parent:
- 0:5391ae63bb4d
- Commit message:
- blinking led after pressing button
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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