Arduino Beginner Project #3: How to Build Simple Torchlight using Arduino Uno

 Arduino Beginner Project #3: How to Build Simple Torchlight using Arduino Uno

 

About Project: 

The LED will light up when push button is pressed.

Components:

  • Arduino Uno
  • Breadboard 
  • LED 
  • Push button
  • Resistor 220 Ohm  
  • Resistor 10k Ohm
  • Jumper Male-to-male  
  • USB cable

 

Schematic Diagram:

 


 

  Coding using Arduino IDE:

#define LED 11
#define BUTTON 2
int button_state;

void setup() {
  pinMode(LED,OUTPUT);
  pinMode(BUTTON,INPUT);

}

void loop() {
  button_state = digitalRead(BUTTON);
  if (button_state == LOW)
  {
    digitalWrite(LED,HIGH);
  }
  else
  {
    digitalWrite(LED,LOW);
  }
}


Watch this project tutorial on Youtube:





 
Thank you.

Comments

Popular posts from this blog

IoT Beginner Project #2: How to Monitor Temperature Data with LED Alert using BLYNK App

IoT Beginner Project #1: How to Blink LED using BLYNK App Button with Internet of Things (IoT) via ESP32 Wifi

Arduino Beginner Project #2: How to Blink RGB (Red Green Blue) LED using Arduino Uno