Introduction: Red Light, Green Light, 123
In this LED arduino, it will teach you how to make your very own traffic light!! Make sure to follow the code and arduino set up! Good luck and have fun!!
Step 1: Code
This is the code for the traffic light.
In the void setup you activate your outputs by writing a "pinMode"
In your loop, you start your line of code with "digitalWrite" which is used to tell an object to go on or off
Then you write your pin number, in this example, either 11, 12, or 13
Then write HIGH, which turns on the light
Then you "delay", so the light stays on for a period of time
You write LOW, to turn off the light
Then do the same steps for the next color (pin number)
Step 2: Arduino Set Up
1. Place a wire into ground and connect it to the red positive side of your bread board
2. Place three more wires out of each pinMode into the breadboard
3. Place a green, yellow, and red light with the short leg in ground and long leg next to the wire