Curriculum
Course:
Push Button With Led
Login
Curriculum
Push Button With Led
project 2 - LED Blink with Push Button
0/6
About the Project
Text lesson
Preview
Circuit Diagram for MBlock
Text lesson
Preview
MBlock Coding
Text lesson
Preview
Circuit Diagram for arduino
Text lesson
Preview
Arduino IDE Coding
Text lesson
Preview
Output
Text lesson
Preview
Project 2 - Do on Your Self
0/5
Push Button with LED and Buzzer
Text lesson
Preview
Circuit Diagram
Text lesson
Preview
Mblock Coding
Text lesson
Preview
Arduino IDE Coding
Text lesson
Preview
Output
Text lesson
Preview
Text lesson
Output
Output
Expected Output
Press Button → LED ON
Release Button → LED OFF
Student Observation
Arduino internal resistor works automatically.
No external resistor needed for button.
INPUT_PULLUP uses reverse logic.
Important Note
Why LOW when button is pressed?
Because:
Pin is normally connected internally to HIGH.
Pressing button connects it to GND.
So Arduino reads LOW.
when Arduino Uno starts up
forever
set
buttonstate
to
read digital pin
2
if
buttonstate =
1
then
set digital pin
13
output as
high
else
set digital pin
13
output as
low
Sign In
Continue with
Google
or sign in with email
The password must have a minimum of 8 characters of numbers and letters, contain at least 1 capital letter
Remember me
Sign In
Sign Up
Restore password
Send reset link
Password reset link sent
to your email
Close
Your application is sent
We'll send you an email as soon as your application is approved.
Go to Profile
No account?
Sign Up
Sign In
Lost Password?
×
×
Cart