I am making the traffic signal management system in which I need four roads and each road has a traffic light. At this time I made the traffic light for single road it works fine and run once after that it should switch the next road but in my code both function runs at the same time. How I can switch this in the road-2
section after completing the road-1 signal. How I can apply the condition on the signal_1()
that signal_2()
will run after the first one.
You can check my code in fiddle