What you will make:
I assume you have already accomplished how to turn a LED on and off. Wouldn’t it be great if we are also able to make a cool application out of it. Today we are going to do just that. We will make traffic light signals.
What you will need:
For this project you will need:
- Connect the components as shown in schematic.
- Upload the code provided above and you are done.
Inside the forever() function, we are using the set digital pin() function and wait(). So, as we observe that Red light turn ON first then Yellow and finally Green. Also Red light stays ON longer than green and yellow light.