All Lessons
LESSON 02Beginner

Add a Button: You Control the Light

~4 min8 components Video Coming Soon

Watch the Lesson

Video Coming Soon!

We're filming this lesson right now

About this Lesson

Add your first INPUT. A pushbutton tells the Arduino when to act. Press and hold — LED on. Release — LED off. Then flip the logic and make it work in reverse. Your first if/else, your first real decision in code.

What You'll Do

1
Start from Lesson 01 — the LED blink circuit
2
Add a pushbutton to the breadboard
3
Connect a 10kΩ pull-down resistor to the button
4
Wire the button to digital pin 2 on your Arduino
5
Write your first if/else statement in code
6
Press the button — LED on. Release — LED off. You control it!

Components Needed

  • Arduino Uno
  • USB Cable
  • 1× LED
  • 220Ω Resistor
  • Pushbutton
  • 10kΩ Resistor
  • Breadboard
  • 4× Jumper Wires

Don't have the parts?

The Robotik Starter Kit includes everything you need for this and all beginner lessons.

Order Starter Kit →