- red light is on for the sum of the green and yellow light


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.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: - red light is on for the sum of the green and yellow light
Reference No:- TGS01602698

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)