Hardware Reference
In-Depth Information
Figure 1-13:
Wiring up a
switch.
Connect an LED
You will connect the LED so current flows from the 5V terminal, through a resistor (to limit
the current so the LED is not damaged) and the LED, then through the output terminal on
PiFace, through the transistor and to ground. LEDs only work if current flows through them
one way, so it matters which lead you connect to positive. For most LEDs the longer leg indi-
cates the anode , which should be connected to the resistor and then the 5V terminal as
shown in Figure 1-14.
Connect the LED and resistor together and then connect the anode of the LED to the 5V
terminal. Now is a good time to check if the LED will work. Briefly touch the other lead of the
LED, called the cathode, to GND. You should see the LED glow. If not, check your wiring and
make sure that you have identified the anode and cathode correctly. (You shouldn't have
damaged the LED if you got the polarity wrong.)
Search WWH ::




Custom Search