User Manual
41
Lesson 2 Controlling an LED by a Button
Introduction
In this lesson, w e 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
- 1 * T-Extension Board
- 1 * 40-Pin Cable
Principle
Button
Buttons are a common component used to control electronic dev ices. 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. Pin
1 is connected to pin 2 and pin 3 to pin 4. So you just need to connect either of pin 1 and
pin 2 to pin 3 or pin 4.
The following is the internal structure of a button. Since the pin 1 is connected to pin
2, and pin 3 to pin 4. The symbol on the right below is usually used to represent a
button in circuits.
SunFounder