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