Question
(Two-way Traffic light)- Develop a python that simulates a two-way (North-South and West-East) traffic lights. Three LEDs (green, yellow, red) needs to be turned on
(Two-way Traffic light)- Develop a python that simulates a two-way (North-South and West-East) traffic lights. Three LEDs (green, yellow, red) needs to be turned on in a sequence for both ways. The sequence is as follow:
When the light is green in North-South side, the light in the West-East is red.
When the light turns yellow in North-South side, the light in the West-East side is still red.
When the light in North-South turns red, the light in West-East becomes green. This process needs to be continued.
Make the duration of the green light to be 5 seconds, yellow light 1 seconds and the red light 5 seconds.
Use 330 resistors to protect the LEDs from burning out.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started