Arduino LED Chaser
![LEDchaser.png](/proxy/?url=https://content.instructables.com/FQA/FQFX/KKTQ8KJN/FQAFQFXKKTQ8KJN.png&filename=LEDchaser.png)
A set of astounding lights that goes in patterns. It's basic and insructions are included. This one goes in a rainbow pattern, but you can make yours any color you want!
Supplies
9 LEDs
19 wires
Any arduino board with gnd and at least 9 pins
Any breadboard that fits 9 LEDs
Choose the LEDs
![chooseled.png](/proxy/?url=https://content.instructables.com/F91/6GSK/KKTQ8MC9/F916GSKKKTQ8MC9.png&filename=chooseled.png)
Choose the 9 LEDs you want. We made it\: red, orange, yellow, green, blue,white,red, red, red.
Connecting the LEDs to the Gnd
![groundattached.png](/proxy/?url=https://content.instructables.com/FYZ/GPQQ/KKTQ8O5M/FYZGPQQKKTQ8O5M.png&filename=groundattached.png)
Connect all the LED negative pins to gnd with wires.
Using Pins 1-9
![LEDchaser.png](/proxy/?url=https://content.instructables.com/FGT/OAIT/KKTQ8JM9/FGTOAITKKTQ8JM9.png&filename=LEDchaser.png)
Connect each led positive side to a pin, from the first red - TX, to the final red - should be pin 9.
Time to Code, If You Forgot
![download (1).jpg](/proxy/?url=https://content.instructables.com/F2C/F8TT/KKTQ8K0J/F2CF8TTKKTQ8K0J.jpg&filename=download (1).jpg)
I'll copy and paste, so you can see the code. Here's thhe co
void setup()
{ pinMode(1,OUTPUT); pinMode(2,OUTPUT); pinMode(3,OUTPUT); pinMode(4,OUTPUT); pinMode(5,OUTPUT); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); pinMode(9,OUTPUT); }
void loop() { int i;
// 1st pattern repeat 1 times for(i=1; i<=10; i++) { digitalWrite(i,HIGH); delay(50); digitalWrite(i,LOW); delay(50); } for(i=10; i>=1; i--) { digitalWrite(i,HIGH); delay(50); digitalWrite(i,LOW); delay(50); } delay(1000);
//2nd pattern repeat 1 times
for(i=1; i<=10 ; i++) { digitalWrite(i,HIGH); delay(50); } for(i=1; i<=10 ; i++) { digitalWrite(i,LOW); delay(50); } for(i=10; i>=1 ; i--) { digitalWrite(i,HIGH); delay(50); } for(i=10; i>=1 ; i--) { digitalWrite(i,LOW); delay(50); } delay(1000);
//3rd pattern repeat 1 times
for(i=1; i<=10 ; i++) { digitalWrite(i,HIGH); delay(50); } for(i=11; i>=1 ; i--) { digitalWrite(i,LOW); delay(50); } for(i=10; i>=1 ; i--) { digitalWrite(i,HIGH); delay(50); } for(i=1; i<=10 ; i++) { digitalWrite(i,LOW); delay(50); } delay(1000);
//4th pattern repeat 1 times
for(i=1; i<=5 ; i++) { digitalWrite(i,HIGH); digitalWrite(11-i,HIGH); delay(100); } for(i=1; i<=5 ; i++) { digitalWrite(i,LOW); digitalWrite(11-i,LOW); delay(100); } delay(100); for(i=1; i<=5 ; i++) { digitalWrite(i,HIGH); digitalWrite(11-i,HIGH); delay(100); } for(i=5; i>=1 ; i--) { digitalWrite(i,LOW); digitalWrite(11-i,LOW); delay(100); } delay(1000); //5th pattern rpeat 1 time for(i=1 ; i<=3 ; i++) { digitalWrite(i,HIGH); digitalWrite(i+3,HIGH); digitalWrite(i+6,HIGH); delay(500/i); } delay(500); for(i=1 ; i<=3 ; i++) { digitalWrite(i,LOW); digitalWrite(i+3,LOW); digitalWrite(i+6,LOW); delay(500/i); }
delay(1000);
}
Like Share Comment and Follow!
![set-posts-like-follow-share-comment-social-media-illustration-design-33061488.jpg](/proxy/?url=https://content.instructables.com/FFA/8UYN/KKTQ8K5A/FFA8UYNKKTQ8K5A.jpg&filename=set-posts-like-follow-share-comment-social-media-illustration-design-33061488.jpg)
Remember to like share comment and follow!