MULTIPLE LED BLINKS
MULTIPLE LED BLINKS
INTRODUCTION:
we can glow multiple LED with the help of arduino.due to it's schedular library we can do so.
now let's see how things happend......................................
HARDWARE REQUIRED:
- Arduino (uno)
- breadboard
- five LED
- jumper wire
THE CIRCUIT:
here we connect all the positive side LED pin to the arduino (digital pin) we started from 13 no. pin afterthat 12,11,10 and 9 by using jumper wire and breadboard. now connect a negetive pin of LED with arduino using jumper wire.and same way by using jumper wire conncet all the negetive pin with ground.
CODE:
void setup(){
// put your setup code here, to run once:
pinMode(13,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
pinMode(9,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,HIGH);
digitalWrite(9,HIGH);
delay(5000);
digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
delay(1000);
digitalWrite(13,LOW);
digitalWrite(12,HIGH);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
digitalWrite(9,LOW);
delay(1000);
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
delay(1000);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
digitalWrite(9,HIGH);
delay(1000);
digitalWrite(13,HIGH);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
delay(1000);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,HIGH);
digitalWrite(10,HIGH);
digitalWrite(9,HIGH);
}
NOTE:HERE WE CAN USE RESISTOR (220 ohm) ALSO GENERALLY RESISTOR IS USED FOR TO PROTRCT OUR LED WE CONNECT OUR RESISTOR WITH THE POSITIVE PIN OF LED.
Comments
Post a Comment