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.
main.cpp@0:c7ce501d534b, 2020-11-01 (annotated)
- Committer:
- titig
- Date:
- Sun Nov 01 11:31:10 2020 +0000
- Revision:
- 0:c7ce501d534b
- Child:
- 1:aa3ea7b4673e
Switch off the YELLOW light when Button is ON
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
titig | 0:c7ce501d534b | 1 | #include "mbed.h" |
titig | 0:c7ce501d534b | 2 | DigitalOut trafficYellowlight(p5); //Yellow light pin declaration |
titig | 0:c7ce501d534b | 3 | DigitalIn pedestrainButton(p8); //Switch button pin declaration |
titig | 0:c7ce501d534b | 4 | int main() { |
titig | 0:c7ce501d534b | 5 | while(1) |
titig | 0:c7ce501d534b | 6 | { |
titig | 0:c7ce501d534b | 7 | |
titig | 0:c7ce501d534b | 8 | trafficYellowlight=0; //Initialize Yellow light to ON |
titig | 0:c7ce501d534b | 9 | trafficYellowlight=!pedestrainButton; // Switching OFF when Button is Pressed |
titig | 0:c7ce501d534b | 10 | wait_ms(500); |
titig | 0:c7ce501d534b | 11 | } |
titig | 0:c7ce501d534b | 12 | } |
titig | 0:c7ce501d534b | 13 |