User Manual

23
Lesson 2 Controlling an LED by a Button
Introduction
In this lesson, we will learn how to turn an LED on or off by a button.
Components
- 1 * Raspberry Pi
- 1 * Breadboard
- 1 * LED
- 1 * Button
- 1 * Resistor (220Ω)
- Jumper wires
Principle
Button
Buttons are a common component used to control electronic devices. They are usually
used as switches to connect or disconnect circuits. Although buttons come in a variety of
sizes and shapes, the one used here is a 6mm mini-button as shown in the following pictures.
Pins pointed out by the arrows of same color are meant to be connected.
When the button is pressed, the pins pointed by the blue arrow will connect to the pins
pointed by the red arrow (see the above figure), thus closing the circuit, as shown in the
following diagrams.