Two LED blinking in pattern programming by ARDUINO
//program for TWO LED blinking one by one
//by-ALOK KUMAR PANDEY
//....................................................................................//
int led1 =13, led2 =12;
void setup()
{
pinMode(led1, OUTPUT); // here pin 13(i.e. led1) set as output pin
pinMode(led2, OUTPUT); // here pin 12(i.e. led2) set as output pin
}
void loop()
{
digitalWrite(led1, HIGH); // here we set led1 as low(i.e. pin no. 13) it means led1 get on.
digitalWrite(led2, LOW); // here we set led2 as high(i.e. pin no. 12) it means led1 get off.
delay(1000);
digitalWrite(led1,LOW); // here we set led1 as low(i.e. pin no. 13) it means led1 get off.
digitalWrite(led2, HIGH); // here we set led2 as high(i.e. pin no. 12) it means led1 get on.
delay(1000);
}
Comments
Post a Comment