Hardware Reference
In-Depth Information
Solution
Connect an LED to one of the GPIO pins using a series resistor to limit the current. To
make this recipe, you will need:
▪ Breadboard and jumper wires (see “Prototyping Equipment” )
▪ 220 Ω to 470 Ω resistor (see “Resistors” )
▪ LED (see “Opto-Electronics” )
WARNING
The value of the current limiting resistor depends on the LED you are using. The Bone can
drive only 4 to 6 mA, so you might need a larger resistor to keep from pulling too much cur-
rent. A 330 Ω or 470 Ω resistor might be better.
Figure 3-3 shows how you can wire the LED to pin 14 of the P9 header ( P9_14 ). Every
circuit in this topic ( Recipe 1.5 ) assumes you have already wired the rightmost bus to
ground ( P9_1 ) and the next bus to the left to the 3.3 V ( P9_3 ) pins on the header. Be sure
to get the polarity right on the LED. The short lead always goes to ground.
Figure 3-3. Diagram for using an external LED
After you've wired it, start Cloud9 (see Recipe 1.6 ) and enter the code shown in
Example 3-2 in a file called externLED.js .
Search WWH ::




Custom Search