Hardware Reference
In-Depth Information
7. Change the directory to the piface directory and then the python directory by typing
cd piface/python .
8. Install the Python module that talks to PiFace Digital by typing sudo python
setup.py install . After a few minutes the necessary iles will be installed, and you
will be ready to start testing with real hardware.
9. Finally, shut down the Pi and remove the power before connecting the PiFace interface
by typing sudo halt .
It is useful to know how to install software manually, but if in the future you want to install PiFace
Digital with one command, instructions are provided at www.piface.org.uk .
Connecting PiFace Digital
Disconnect the power before connecting or disconnecting anything to or from the Raspberry
Pi. his ensures that you don't accidentally short anything and is generally safer. Position
PiFace Digital so it lines up with the edges of the Raspberry Pi and check that all 26 pins of
the expansion port line up with the holes in the connector. Gently push the PiFace interface
down, making sure that you don't push sideways to bend the pins. If it is correctly lined up,
it should slide smoothly. Connect the power, log in and start X, as described in Chapter 1.
Using the Emulator
his topic mentions the importance of regular testing and checking that subsystems work before
moving on. his is a great excuse for turning some lights on and of. here's something satisfying
about seeing a computer responding to you, lighting a light, obeying your command! Next you
will use the PiFace emulator to check that your Raspberry Pi can talk to your PiFace Digital.
Start the emulator by typing piface/scripts/piface-emulator in a Terminal window.
he emulator window will appear as shown in Figure 9-2.
As you want to manually control the outputs, in the PiFace Emulator window click Override
Enable.
Toggle Output Pin 1 on by clicking it. he PiFace interface will click as the relay turns on, and
the corresponding LED will illuminate. Notice the graphic on-screen updates to show the
LED being on, the contacts have changed over on the relay and the irst output pin is on.
Try turning multiple output pins on, and notice how the on-screen display updates. Try the
All On, All Of and Flip buttons to discover what they do.
 
Search WWH ::




Custom Search