traffic light
I want to make a traffic light system so I searched on the arduino project HUB to find a close idea and do it. Because when I was little I loved watching their colors
Software
to stimulate circuit
to upload code to arduino board
5 v adaptor
bread board
crocodiles wires
220 ohm resistors
jumpers
LEDs
arduino board
i used if condition and divided potentiometer range on three for three lamps
connection:
red LED on pin 5.
yellow LED on pin 3.
green LED on pin 4.
3 resistors each LED have resistor .
potentiometer 3 pins one on ground one on positive and the middle on pin A0 .
code blocks:
I want to Control with potentiometer in changing between LEDs colors.
so MARAM suggested if condition.
my input is potentiometer
and output is LEDS light
I copied the code from tinkercad to arduino.
Then downloaded on arduino board.
then connected all electronic parts together.
At first I wrote a code like this so the stimulus results were unwanted.
2 LEDs light in he same time.
MARAM and ASMAA SAIED helped me in this part and suggested to make digital write for each LED.
It's my first time using Arduino UNO.
I am sure it will help me so much in my final project