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:392dea3408f2, 2020-11-01 (annotated)
- Committer:
- harerimana
- Date:
- Sun Nov 01 13:01:46 2020 +0000
- Revision:
- 0:392dea3408f2
- Child:
- 1:18bf4c2c22ec
Switch off the YELLOW light when Button is ON
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
harerimana | 0:392dea3408f2 | 1 | ##include "mbed.h" |
harerimana | 0:392dea3408f2 | 2 | DigitalOut trafficYellowlight(p7);// declaration of Pin 7 as output |
harerimana | 0:392dea3408f2 | 3 | DigitalIn pedestrainButton(p8); // declaration of Pin 8 as Input |
harerimana | 0:392dea3408f2 | 4 | int main() { |
harerimana | 0:392dea3408f2 | 5 | while(1) |
harerimana | 0:392dea3408f2 | 6 | { |
harerimana | 0:392dea3408f2 | 7 | |
harerimana | 0:392dea3408f2 | 8 | trafficYellowlight=0; |
harerimana | 0:392dea3408f2 | 9 | trafficYellowlight=!pedestrainButton; |
harerimana | 0:392dea3408f2 | 10 | wait_ms(5000); |
harerimana | 0:392dea3408f2 | 11 | } |
harerimana | 0:392dea3408f2 | 12 | } |