0% found this document useful (0 votes)
31 views8 pages

Experiment 2 Push Button

exp2

Uploaded by

23eg104d61
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)
31 views8 pages

Experiment 2 Push Button

exp2

Uploaded by

23eg104d61
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/ 8

Experiment 2 : Controlling LED

Interface with Arduino using Push


Button
Aim
● The main objective of this experiment is

1. To turn ON an LED when push button is pressed,


OFF when push button is released

2. To blinking LED using push button with delay of 3


second

2
Circuit Diagram

3
Connection Diagram

4
Program
Int v = 0;
void setup()
{
pinMode(13, OUTPUT);
pinMode(2, INPUT);
}

void loop()
{
v = digitalRead(2);
digitalWrite(13, v);
}

5
Program using if else Statements
#define LED 13
#define PUSHBUTTON 7
int Button_State = 0; // variable for reading the push button status

void setup(){
pinMode();
pinMode();
}

void loop(){
Button_State = digitalRead();
if (Button_State == HIGH) { // turn LED on:
statements;
}
else { //turn LED off
statements;
}
}

6
Self Assessment Questions

1. How many PWM Pins Available in Arduino UNO?

2. List out the pin terminals in push button

3. Is that 5V Supply is mandatory for push button? Why?

7
THANK YOU

Team – Fundamentals of IoT & Sensors

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