Controlling LED by Using Button

by chenmia0724 in Circuits > Arduino

110 Views, 0 Favorites, 0 Comments

Controlling LED by Using Button

07C1E76A-6848-4AA6-9ED6-EA3BCBE1246A.jpeg
5C287468-BCE4-44AC-8CCB-324B2D85BD64.jpeg

Using button to control LED on / off.

Supplies

-Arduino Leonardo board * 1

- USB cable * 1

- Resistor (10kΩ) * 1

-LED * 1 - Button * 1

- Capacitor 104 * 1

-Breadboard * 1

-Jumper wires

Prepare All the Supplies You Will Need

A72D983F-7732-4FD6-A345-D79AB2BC0EE6.jpeg

Procedures

37306586-1408-412A-A48F-8FEE5AB99247.jpeg

Step 1: Build the circuit.

Step 2: Download the code from: https://github.com/primerobotics/Arduino

Step 3: Upload the sketch to the Arduino board.

Source of inspiration: https://www.instructables.com/Controlling-LED-by-B...

The Code

Result!!