Question: I have all the other code I just need help with the night mode emergency push button code. Modify project 1 to simulate the working
I have all the other code I just need help with the night mode emergency push button code. Modify project to simulate the working of two sets of traffic lights at an intersection as shown below. Here
are the sequence of events:
a When program starts, all traffic lights will be red for seconds.
b The green lights for the two left arrows turn on simultaneously.
c After seconds, the two left arrows will go to amber and then red.
d After seconds from the left arrows being red to clear the intersection, the EW and WE lights will
turn green.
e After seconds, the WE and EW lights will go to amber and then red together.
f After seconds from all lights to be red to clear the intersection, the NS and SN lights will go
green together.
g After seconds, the NS and SN lights will go to amber and then red together.
h The EW pedestrian light will be green when the NS light is green and red otherwise. The NS
pedestrian light will be green when the EW light is green, red otherwise.
i The pattern will repeat again starting at point a above.
Add a nightemergency pushbutton such that if it is pressed at any moment, the current traffic cycle in
either the EW including the arrow or NS direction will finish its normal sequence but will not go to the
next direction. Instead, the system will flash red lights for the NS and yellow lights for the EW until the
emergency button is pressed again. Pedestrian lights should flash red only. Note that the pushbutton
should be pressed once to activate the emergency mode. No need to hold the pushbutton to activate. If the
emergency button is pressed while ALL lights are red, there is no need to start a new cycle.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
