PiFace is an IO board for the Raspberry Pi computer — 8 buffered inputs, 8 outputs, and two relays that theoretically can handle 10 amperes at 230 volts. See Gordon’s Projects for a full review. The model allows you to disconnect the relays from two of the outputs, and there is a Python interface. To test the board (and my understanding of it), I rigged up a simple circuit with one external switch — a Morse code type key — one, LED, and one resistor. Below are photos of (i) the PiFace board riding on top of the Raspberry Pi, (ii) the circuit board (iii) the whole kit-and-kaboodle, (iv) the circuit.
The code for running the circuit is at gitHub. (i) Use on(7)
and off(7)
to turn the LED on an off manually; 7 is the pin the LED is wired to; (ii) use blink(7)
for a more exciting test; (iii) use read(0)
to read the switch, which is attached to pin 0; (iv) use control(7,0)
to control LED on pin 7 by the switch on pin 0 — flip the switch attached to pin 0 and ground to turn on the LED on pin 7. Of course all this is ridiculous overkill, but the idea is to get started and to test the PiFace + Raspberry Pi combo.
Note added: Stephen Visser has an excellent article on the PiFace.