2023 - Fall - Progress Test 1 Example
2023 - Fall - Progress Test 1 Example
Description:
- There are 6 leds in the traffic light system: G1, Y1, R1 and G2, Y2, R2 (represent for Green,
Yellow and Red of Street 1-3 and 2-4, respectively).
- There are two modes: auto and manual. If the auto mode is selected, traffic lights operate with the
defined delay. If manual mode is selected, the traffic lights are controlled from serial input.
- In auto mode: the defined delay values are as below:
- In manual mode: input name of light (G1, Y1, R1 and G2, Y2, R2) to turn on the corressponding
light, and the others are controlled accordingly.
- In serial input:
o Type A enter Auto mode
o Type M enter Manual mode
Type G1 turn on Green 1, that means Red 2 is on while Yellow 1, Red 1 and
Green 2, Yellow 2 are off.
Type R1 turn on Red 1, that means Green 2 is on while Green 1, Yellow 1,
and Yellow 2, Red 2 are off.
Reference:
https://www.civil.iitb.ac.in/tvm/nptel/571_TrSignal/web/web.html
1
https://www.tinkercad.com/things/bR15c4ltSPD-copy-of-2-way-traffic-light/editel?tenant=circuits
Answer
Picture of your design:
Code:
Link: