[Hindi / Urdu] LED Sequential Control Simple Arduino Project





Today I am going to show you guys a very simple arduino project for beginners. We’re going to get three different LEDs to turn on and turn off in a simple sequence, like you see here.

For this, you’re going to need an Arduino Uno or similar Arduino board, a breadboard (preferably with a positive and negative rail like this one), four breadboard jumper wires, a USB cable to for the Uno, three LEDs of different colors(here we are using Blue, Red and Green) and 3 220ohm resistors. Now we’re using 220ohm resistors, because they seem to work best with the LEDs we have- but you could use different resistors, depending on your LEDs and your circuit. I’ve put a link to an inexpensive arduino kit that contains all these components in the description below, in case you’re looking to get an arduino uno and all the basic components for this tutorial. 

---------------------------------------------------------------------------------------------------------------------


Arduino Kit - https://goo.gl/HZk1mS
Arduino Board - https://goo.gl/6YJz1mRobot 



---------------------------------------------------------------------------------------------------------------------=























Get the Code:

/* A simple program to sequentially turn on and turn off 3 LEDs */ 

int LED1 = 13;
int LED2 = 12;
int LED3 = 11;

void setup() {
   pinMode(LED1, OUTPUT);
   pinMode(LED2, OUTPUT);
   pinMode(LED3, OUTPUT);
}


void loop() {
  digitalWrite(LED1, HIGH);    // turn on LED1 
  delay(200);                  // wait for 200ms
  digitalWrite(LED2, HIGH);    // turn on LED2
  delay(200);                  // wait for 200ms       
  digitalWrite(LED3, HIGH);    // turn on LED3 
  delay(200);                  // wait for 200ms
  digitalWrite(LED1, LOW);     // turn off LED1
  delay(300);                  // wait for 300ms
  digitalWrite(LED2, LOW);     // turn off LED2
  delay(300);                  // wait for 300ms
  digitalWrite(LED3, LOW);     // turn off LED3
  delay(300);                  // wait for 300ms before running program all over again
}









Comments

Popular posts from this blog

[Hindi / Urdu] Arduino Tutorial Buzzer with LDR and LED

[Hindi / Urdu] Arduino Tutorial LCD Display Control