Hardware Reference
In-Depth Information
Figure 4-1. A pushbutton switch
You're going to use a pushbutton switch to make and break a connection
between 5 volts and one of the digital pins, which will be configured in your
sketch as an input. You're also going to add a pulldown resistor to ensure that
the input is connected to ground when it's not connected to 5 volts. If the
input pin were disconnected from both 5 volts and ground, it would be con-
sidered floating and it would return unexpected results if you tried to read it.
That is because an unconnected pin can be affected by ambient electrical
activity (without the pulldown resistor, the pin essentially functions as an
antenna). See Figure 4-4 for a closer look at the pulldown resistor in the cir-
cuit.
Here's what you'll need to try this example:
• Breadboard (Makershed.com part number MKEL3, Adafruit.com part
number 64, Sparkfun.com part number 12002)
• Jumper wires (Makershed.com part number MKSEEED3, Adafruit.com
part number 758, Sparkfun.com part number 08431)
• Pushbutton switch (For the most basic type of switch that will fit in a
breadboard: Adafruit.com part number 00097, Sparkfun.com part num-
ber 00097)
• 10K ohm resistor (Assorted resistor packs: Makershed.com part num-
ber MKEE4, Sparkfun.com part number 10969)
Search WWH ::




Custom Search