Knight Rider Arduino
This is a tutorial on how to make a simple knight rider aka blinking led wave.
What You Need
5 leds
5 220 ohm resistors
Arduino
Usb cable
Breadboard
5 220 ohm resistors
Arduino
Usb cable
Breadboard
Wiring
Well what you need to do is for the first led connect it to the resistor to pin 6 digital. Then for the other leds it will go in order so led 2 goes to pin 5 digital and so on. Everything is in the picture. Hope you get it! Then connect all the leds negative wire thing to GND . That's kinda all though so upload the following code in the next step
The Code
// LED Wave
void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); }
void loop() { digitalWrite(2, HIGH); delay(500); digitalWrite(2, LOW); digitalWrite(3, HIGH); delay(500); digitalWrite(3, LOW); digitalWrite(4, HIGH); delay(500); digitalWrite(4, LOW); digitalWrite(5, HIGH); delay(500); digitalWrite(5, LOW); digitalWrite(6, HIGH); delay(500); digitalWrite(6, LOW); digitalWrite(5, HIGH); delay(500); digitalWrite(5, LOW); digitalWrite(4, HIGH); delay(500); digitalWrite(4, LOW); digitalWrite(3, HIGH); delay(500); digitalWrite(3, LOW); // the loop() will now loop around and start from the top again }
Ending
Well I hope you made this project and have fun like and comment