Instructables

Arduino Flashing LEDS

Picture of Arduino Flashing LEDS
This will get you a very nice set of flashing LEDs just connect the LEDs (I used a breadboard) and turn it on. 
 
Remove these adsRemove these ads by Signing Up

Step 1: Program the Arduino.

Picture of Program the Arduino.
Insert the following Code:
int led1Pin=1;
int led2Pin=2;
int led3Pin=3;
int led4Pin=4;
int led5Pin=5;
int led6Pin=6;
int led7Pin=7;
int led8Pin=8;
int led9Pin=9;


void setup() {
  pinMode(led1Pin, OUTPUT);
  pinMode(led2Pin, OUTPUT);
  pinMode(led3Pin, OUTPUT);
  pinMode(led4Pin, OUTPUT);
  pinMode(led5Pin, OUTPUT);
  pinMode(led6Pin, OUTPUT);
  pinMode(led7Pin, OUTPUT);
  pinMode(led8Pin, OUTPUT);
  pinMode(led9Pin, OUTPUT);
}


void loop() {
  digitalWrite(led1Pin, HIGH);
  delay(100);
  digitalWrite(led1Pin, LOW);
  digitalWrite(led2Pin, HIGH);
  delay(100);
  digitalWrite(led2Pin, LOW);
  digitalWrite(led3Pin, HIGH);
  delay(100);
  digitalWrite(led3Pin, LOW);
  digitalWrite(led4Pin, HIGH);
  delay(100);
  digitalWrite(led4Pin, LOW);
  digitalWrite(led5Pin, HIGH);
  delay(100);
  digitalWrite(led5Pin, LOW);
  digitalWrite(led6Pin, HIGH);
  delay(100);
  digitalWrite(led6Pin, LOW);
  digitalWrite(led7Pin, HIGH);
  delay(100);
  digitalWrite(led7Pin, LOW);
  digitalWrite(led8Pin, HIGH);
  delay(100);
  digitalWrite(led8Pin, LOW);
  digitalWrite(led9Pin, HIGH);
  delay(100);
  digitalWrite(led9Pin, LOW);
}


You can edit the delays for different speeds.

Step 2: Connect the LEDs

Picture of Connect the LEDs
Connect all the LEDs to digital I/0 pins 1-9. You can make them any color you want.
MAKE SURE YOU INCLUDE A 220 Ohm RESISTOR OR YOU MAY BLOW THE CIRCUT!!!!!

Step 3: More!

Try editing the delay(100) for more fun!
angpal5910 months ago
I don't see any video period.
waterlubber (author)  angpal596 months ago
Go blame google-. It's affected youtube negatively, so it should be called Google-
Bot13982 years ago
In the video you didnt show it working.
waterlubber (author)  Bot13982 years ago
Really? It works. Sorry for that.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!