Control Built-in LED Using Push Button With Arduino Nano

by ardhiwahyudhi in Circuits > Arduino

3723 Views, 2 Favorites, 0 Comments

Control Built-in LED Using Push Button With Arduino Nano

WhatsApp Image 2020-06-06 at 11.26.59.jpeg

Arduino has a built-in LED on digital pin 13. Now we will control it using the push button.
Let's make it!

Supplies

1. Arduino Nano

2. Female to female jumper cable (3 pcs)

3. Mini USB cable

4. 220 Ohm resistor

5. Breadboard

Wiring

push button.png

Follow the wiring diagram as shown.

5 V --> one leg of push-button
Gnd --> one leg of the resistor
D2 --> the other leg of the resistor

Code and Upload

1. Copy the code from here: Sketch
2. Paste it on the Arduino IDE
3. Connect the mini USB cable to Arduino Nano
4. Connect the USB cable to your computer
5. Click the upload button and wait for it to finish

Do the Magic!

WhatsApp Image 2020-06-06 at 12.46.31.jpeg

Push the button and see how the magic works