Professional Documents
Culture Documents
2024 - Spring - Progress Test 1 - 02 - SE18xx - Gy
2024 - Spring - Progress Test 1 - 02 - SE18xx - Gy
Description:
1
Rename filename.
- In manual mode: input the name of the light (G1, Y1, R1, and G2, Y2, R2) to turn on the
corresponding light, and the others are controlled accordingly.
- In serial input:
o Type A or press A enter Auto mode.
o Type M or press B enter Manual mode
Type G1 or press C (or R2) turn on Green 1 and Red 2 (after turning on
Yellow 2 for 2 seconds) while the other LEDs are off.
Type R1 or press D (or G2) turn on Red 1 (after turning on Yellow 1 for 2
seconds) and Green 2 while the other LEDs are off.
Note: When changing from Green to Red, Yellow is on for 2 seconds
Note: You can use the button to change mode, and control traffic light in Manual mode.
Reference:
https://www.civil.iitb.ac.in/tvm/nptel/571_TrSignal/web/web.html
https://www.tinkercad.com/things/bR15c4ltSPD-copy-of-2-way-traffic-light/editel?tenant=circuits
Answer
1. Block diagram:
3. Flowchart (algorithm)
4. Code:
2
Rename filename.
5. Tinkercad link: