40
Lesson 13 Button Switch
Introduction
Most
SunFounder boards
already
have
an
LED
attached
to
pin
13 itself. So we
will use a button module and this LED to build a simple circuit and make an LED brighten.
Components
-
1 * SunFounder Uno board
- 1 * USB data cable
- 1 * Button module
- Several jumper wires
Experimental Principle
With the LED attached to pin 13, connect the button module to digital pin 8. When the button
module inducts button-pressing signals, the LED will be on. Otherwise, it will be off.
Experimental Procedures
Step 1:
Build the circuit
Button Module SunFounder Uno
S ------------------------------------- Digital 8
- -------------------------------------- GND
+ --------------------------------------- 5V
Step 2:
Program (Please refer to the example code in
LEARN -> Get Tutorial
on our
website
)
Step 3:
Compile
Step 4:
Upload the sketch to SunFounder Uno
SunFounder