Question: i . Traffic Lights: To develop a C program to simulate the control of traffic lights. Three output ports are used to periodically control the

i. Traffic Lights:
To develop a C program to simulate the control of traffic lights. Three output
ports are used to periodically control the Green, Yellow, and Red LEDs in the
following pattern:
Green LED is turned ON for 5 seconds;
Yellow LED flicker for three times (i.e., ON 0.5s and OFF 0.5s, and
repeat for three times);
Red LED is tumed ON for 5 seconds;
Caution: DO NOT forget to use resistors because directly connecting an
LED may result in a large current burning down the LED.
Fig. 3 Colour LEDs and Resistors
ii. Main Switch to Control the Traffic Lights:
Add a button switch to control all three traffic lights. When the button switch
is pressed down, all traffic lights are turned off. When the button switch is
released, the traffic lights return to their normal working state. A pull-up or
pull-down resistor may be used depending on your own code.
iii. Question to think:
Why the program doesn't respond to the switch input sometimes? Do you
have other solutions other than using the polling method? The i.Traffic Lights part i completed but i have no ideal for ii. Main Switch to Control the Traffic Lights Please use "Tinkercad " to complete the part ii and provide the model picture and code. thanks
 i. Traffic Lights: To develop a C program to simulate the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!