Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 seconds;
Yellow LED flicker for three times ie ON and OFF and
repeat for three times;
Red LED is tumed ON for seconds;
Caution: DO NOT forget to use resistors because directly connecting an
LED may result in a large current burning down the LED.
Fig. 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 pullup or
pulldown 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 iTraffic 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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