0% found this document useful (0 votes)
11 views2 pages

Exp 1 (ii)

The document outlines an experiment to interface a push button with an Arduino to control an LED. It includes a list of required components, circuit connections, and Arduino code to turn the LED on when the button is pressed. The result confirms that the LED will illuminate while the button is engaged and turn off when released.

Uploaded by

kazirabiya785
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Exp 1 (ii)

The document outlines an experiment to interface a push button with an Arduino to control an LED. It includes a list of required components, circuit connections, and Arduino code to turn the LED on when the button is pressed. The result confirms that the LED will illuminate while the button is engaged and turn off when released.

Uploaded by

kazirabiya785
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Experiment No 1 B

Aim: To interface Push button with Arduino and write a program to ‘turn ON’ LED when
push button is pressed.

Component Required:

Sl No Components Quantity
1 ARDUINO UNO BOARD 1
2 LED 1
3 USB cable for ARDUINO 1
4 Connecting wires --
5 Push Button 1
6 Bread Board 1
7 Resistance 220ohm and 1Kohm 1

Circuit Connection:

Figure: Controlling LED using Push Button switch


Arduino Code to interface push button to control LED

#define LED_PIN 8
#define BUTTON_PIN 7
void setup()
{
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT);

void loop()
{
if (digitalRead (BUTTON_PIN)==HIGH)
{
digitalWrite(LED_PIN, HIGH);
}
else
{
digitalWrite(LED_PIN, LOW);

Result: LED will be ON when push button is pressed and LED will be OFF when button is
released.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy