loading
Picture of Multiple Blinking LED on the Arduino
In this tutorial I will show you how to make multiple LEDs blink with Arduino.  You will need three LEDs, jumper wires, breadboard, and Arduino.

Step 1: Program The Arduino

Picture of Program The Arduino
Now you will need to paste the following code into the Arduino software and upload it to the Arduino.

int led = 13;
int led2 = 12;
int led3 = 11;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT); 
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(100); 
  {digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay(100);}
{digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay(100);}// wait for a second
}

 
victorg1316 days ago

are you not using resistors on your leds

rcruz32 made it!4 months ago

Thanks man! I add 3 more LEDs and it works great!!

IMG_1749.jpg
vjoshi14 made it!5 months ago
great to see my first arduino project being supported by instructables
temp_102198938.jpg
ariphy10 made it!5 months ago
thanks for sharing the code. I'm new to arduino programing. I'm able to run this program successfully.
temp_-933096973.jpg
goldenshuttle6 months ago

if the video is private why are you posting the youtube link here ? is it to show us the black screen ? thanks for sharing

Oops sorry about that. I fixed it.
TorbenK9 months ago

Help

TorbenK9 months ago

Help

TorbenK9 months ago

It dos not work. why?

TorbenK9 months ago

thanks for your help!!

psycho.maggot10 months ago

i've modified your code, just a little bit here is:

int led = 13;
int led2 = 12;
int led3 = 11;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000);
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay (1000);
{digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay(1000);
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay(1000);}
{digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay (1000);
digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay(1000);}// wait for a second
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay (100);
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay (100);
{digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);}
{digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay (100);
digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay(100);}
}

psycho.maggot10 months ago

its really works!! thanks, but i think you should add the resistors to the led. i using 220k resistor and 3 different leds,

maxyfun1 year ago

Perhaps you can help me

Im looking for code that will switch an LED on then off withing a single loop

without using the delay() function. Everywhere I look there are modified versions of the 'blink without delay' however they all have the same issue

loop starts the use millis() and a few variable to check the state if its high or low then swop the state over but only swops it once so the loop runs it switches on then the loop has to run a second time before it switches off. Any ideas?

http://arduino.cc/en/Reference/analogWrite

using the analog pins should help with your problem.

Hi, could you explain why we would list int led = 13; and not int led 1 = 13
I know default 13 is a blink led , is that why ?
Can we use 13 for other things , what do we have to do different while addressing pin 13?
Thanks.

int led = 13;
int led2 = 12;
int led3 = 11;

mralr1 year ago

worked! thanks

cwolter971 year ago
I would just like to say I hope you know the comments are incorrect about the length of time the delays are.

The delay you have it set to is to delay for 1/10 of a second
The Electrodog Show (author) 1 year ago
Thanks! Glad it worked.
o__o2 years ago
Thanks! This is explained perfectly, this is my first aduino project ever and it turned out beautifully!