ArduinoInventorsGuide_sample_Project2.pdf

(6104 KB) Pobierz
a blinking pattern on
three
LEDs. Your mission, should you choose
to accept it, is to build and program a stoplight for a busy hallway in
your house (see Figure 2-1).
FIGURE 2-1:
The completed
Stoplight project
M AT E R I A L S TO G AT H E R
The materials in this project are all pretty simple. All of the electronic
parts are standard in the SparkFun Inventor’s Kit, except for the ones
marked with an asterisk (*). If you’re using your own kit or piecing
together parts yourself, see the following parts list. Figure 2-2 shows
all of the parts used in this project.
Electronic Parts
One SparkFun RedBoard (DEV-13975), Arduino Uno (DEV-11021),
or any other Arduino-compatible board
One USB Mini-B cable (CAB-11301 or your board’s USB cable;
not shown)
One solderless breadboard (PRT-12002)
One red LED, one yellow LED, and one green LED (COM-12062)
Three 330
resistors (COM-08377, or COM-11507 for a pack of 20)
Male-to-male jumper wires (PRT-11026)
Male-to-female jumper wires (PRT-09140*)
(Optional) One 4 AA battery holder (PRT-09835*; not shown)
©
¨
§
¦
¥
¤
£
¢
¡
 
FIGURE 2-2:
Components for the
Stoplight
Other Materials and Tools
If you want to build an enclosure like the one in Figure 2-1 or follow
the suggestions in “Going Further” on page 64, you’ll also need the
following supplies, shown in Figures 2-3 and 2-4:
Pencil
Craft knife
Metal ruler
Pliers
Wire stripper
Glue (hot glue gun or craft glue)
(Optional) Drill and a 3/16-inch drill bit
(Optional) Soldering iron
(Optional) Solder
(Optional) Helping hands (not shown)
Cardboard (about 12 inches square) or a cardboard box
Two ping-pong balls
Enclosure template (see Figure 2-15 on page 55)
NOTE
Good, clean cardboard will
be worth its weight in gold
in these projects. We sug-
gest picking up cardboard
sheets from a craft or art
supply store.
©
¨
§
¦
¥
¤
£
¢
 
FIGURE 2-3:
Recommended tools
FIGURE 2-4:
Recommended building
materials
N E W CO M P O N E N T : T H E R E S I S TO R
Although you used an LED on its own in Project 1, in most cases
it’s best to use a
resistor
to protect the LED from too much cur-
rent. Resistors like the ones in Figure 2-5 are everywhere. They are
indispensable when you’re building circuits, and you’ll need them to
complete this project, too.
©
¨
§
¦
¥
¤
£
¢
Zgłoś jeśli naruszono regulamin