LED + Push Button

What will we do

This example uses 2 LEDs and a switch to make an ON/OFF door lock. When the RED LED is ON then the door lock is closed. When you press the BUTTON, door will open and the RED LED will be off and the GREEN LED will be ON.

Parts List

You will need the following parts:
    1x arduino uno
    1x arduino uno USB Cable
    1x Breadboard
    5x Jumper Wire
    1x Red LED
    1x Green LED
    1x Push button switch
    3x Resistors
Please ensure that you have mBlock setup on you computer. Click here to setup mBlock
You purchased your Arduino kit from here
Arduino UNO R3 Basic Starter Kit

Wiring it up

Ensure that the LEDs are the right way around, with the longer positive leads (anodes) to the left.

Block Coding

mBlock Block-Based IDE- Coding for Beginners
Last modified 8mo ago