Data Sheet
20 
Lesson 3    Digital Inputs-Switches 
Overview 
In this lesson, you will master how to use buttons with digital inputs to turn LED on and off. 
Components Required 
Name  Qty  Name  Qty 
UNO R3 or MEGA 2560  1  220Ω Resistor  1 
5mm Red LED  1  DuPont Wire  7 
Push Switches  2  Breadboard  1 
Component Introduction 
The switch is a simple component. When you press a button or flip a lever, they 
connect two contacts together so that electricity can flow through them. 
Actually,  there  are  only  really  two  electrical  connections.  Inside  the  switch 
package, pins B and C are connected together as same as pins A and D. 
Wiring Diagram 
Result 
Press the left button, the LED will be lit, and press the right button, LED will be extinguished. 










