How to Make Arduino Traffic Light from Cardboard

preview_player
Показать описание
In this video, you will learn how to Make an Arduino Traffic Light for Science Project

Materials Used:
1) 2 RED LED, 2 GREEN LED, 1 YELLOW LED
2) 6, 330 OHM resistors
3) Arduino UNO
4) Flats/Jumper Wires
5) Breadboard
6) Cardboard/Sticks

SKETCH: const int ledRed = 13;
const int ledGreen = 12;
const int ledyellow = 11;
const int buttonPin = 10;
const int ledpedRed = 9;
const int ledpedGreen = 8;
int buttonState = 0;
void setup() {
pinMode(ledRed, OUTPUT);
pinMode(ledGreen, OUTPUT);
pinMode(ledyellow, OUTPUT);
pinMode(ledpedRed, OUTPUT);
pinMode(ledpedGreen, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop() {
buttonState = digitalRead(buttonPin);
if(buttonState == HIGH){
digitalWrite(ledpedRed, LOW);
digitalWrite(ledGreen, LOW);
digitalWrite(ledpedGreen, HIGH);
digitalWrite(ledyellow, HIGH);
digitalWrite(ledRed, HIGH);
delay(1000);

digitalWrite(ledGreen, HIGH);
digitalWrite(ledyellow, LOW);
delay(1000);
digitalWrite(ledyellow, HIGH);
digitalWrite(ledRed, LOW);
delay(1000);
digitalWrite(ledpedRed, HIGH);
digitalWrite(ledRed, LOW);
delay(1000);
digitalWrite(ledpedGreen, LOW);
delay(5000);
digitalWrite(ledpedGreen, HIGH);
digitalWrite(ledGreen, LOW);
digitalWrite(ledRed, HIGH);
digitalWrite(ledpedRed, LOW);
delay(1000);
}else{
}


}
These digital pins also include GND and +5V to power the Arduino

MUSIC:
).
.
).
.
).
.
Рекомендации по теме
Комментарии
Автор

Sorry guys for the late uploading schedule, haven't had time to post content now that school has started. I still appreciate all the support ya'll have given me and I will try to post a new video. Subscribe if you haven't already

bitcodelabs
Автор

Guys got some talent on him. I've been thinking of doing some of this kind of stuff too, you really have ispired me to do some research on arduinos 👌

loosetie
Автор

How are you so good at doing mechanism (cable stuff)!? you are amazing!

diamondprozplayz
Автор

Great and wonderful video tráfic sistem. This is a representation a real trafic sistem amenizing good proyect

rockyrocka
Автор

Great video as always, the editing on this video is amazing :D

danielvilla
Автор

Hey great video, keep coming with good ideas

animatr
Автор

that sum deep stuff man. hope to see you mk a ai or somethin

rydersa
Автор

Fsr ur comment didn’t show up so I subbed and liked

yahelsegura