Hardware Reference
In-Depth Information
Here's how to wire it up and try it out:
1. Insert your pushbutton switch into the breadboard as shown in
Figure 4-1 . If it doesn't snap in easily, it may not be oriented correctly, so
try rotating the switch 90 degrees.
2. Using a jumper wire, connect digital pin 2 of the Galileo to one of the top
terminals of the switch.
3. Connect one of the bottom terminals of the switch to 5 volts.
4. Using a 10K resistor (brown, black, orange, and then gold or silver
stripes), connect the top terminal of the switch to ground. Your circuit
should look like Figure 4-2 or Figure 4-3 .
5. Open a new sketch in the Arduino IDE and enter the code in Example 4-1 .
6. Upload this sketch to Galileo.
Figure 4-2. Connecting a pushbutton switch to digital pin 2 with a 10K pull-
down resistor
Search WWH ::




Custom Search