Header Ads

LED ON/OFF using Arduino


Hi Friends!!!

Let's see little fun with arduino.

LED ON/OFF using Arduino

You need below things,
  • Arduino board
  • LED bulb
  • Resistor
  • Some wire

1). Plug your Arduino board to computer
2). Open Arduino IDE
3). Select ardunio board and COM port
4). Upload below sample code

This is for LED ON

void setup()
{
pinMode(2,OUTPUT);//Your pin.Don't use 0 pin or 1 pin
}
void loop()
{
digitalWrite(2,HIGH);
}

This is for LED OFF

void setup()
{
pinMode(2,OUTPUT);//Your pin.Don't use 0 pin or 1 pin
}
void loop()
{
digitalWrite(2,LOW);
}


This is a video for it



Thank you very much!!!
Powered by Blogger.