Write an Arduino program to turn 3 LEDs on repeatedly in a traffic light pattern of
- Green light is on for 8 sec, and it is connected to pin 5.
- Yellow light is on for 4 sec, and it is connected to pin 6.
- Red light is on for the sum of the Green and Yellow light timing, and it is connected to pin 7.
Declare the three LEDs as integer variables.
Include comments.
Modify the program of Q. 1 as follows.
- After the red light turns off, add a Green light that flashes on and off 5 times at ½ second interval, to be followed by the regular Green light as indicated in Q. 1.
Declare the LEDs as integer variables.
Include comments.