Controlling a LED with a button

In this lesson, we will learn how to detect the state of a button, and then toggle the state of the LED based on the state of the button.

Sep 28, 2020

7775 views

1 respects

Components and supplies

1

Arduino UNO

1

Pushbutton switch 12mm

1

Breadboard (generic)

1

LED (generic)

1

Resistor 10k ohm

1

Jumper wires (generic)

1

Resistor 220 ohm

Apps and platforms

1

Arduino IDE

Project description

Code

_02_ButtonAndLed.ino

arduino

Downloadable files

capture_fQgeQ4j0ps.PNG

capture_fQgeQ4j0ps.PNG

capture_fQgeQ4j0ps.PNG

capture_fQgeQ4j0ps.PNG

Comments

Only logged in users can leave comments