Hardware Reference
In-Depth Information
2
Install the necessary packages by typing
sudo apt-get install python-dev
python-gtk2-dev git
.
Linux will list any other programs necessary and tell you how much additional disk
space is required. Confirm that you want to continue by typing
Y
and pressing enter.
After a few minutes the programs will be installed.
3
Get the latest software to control PiFace by typing the following, after typing
cd
to
return to your home directory:
git clone https://github.com/thomasmacpherson/piface.git
This will copy the latest PiFace code and examples into your home directory. Type
ls
piface
to list the contents of the directory that have just been downloaded.
4
So that all users of the Raspberry Pi can use the SPI bus, you need to change the per-
missions on the
/dev/spi
* files. PiFace Digital provides a handy script to set SPI
permissions. Run the script by typing
sudo piface/scripts/spidev-setup
5
Restart by typing
sudo reboot
Lastly, you need to install the Python modules that will make it easy to send the cor-
rect messages on the SPI bus.
6
Type
cd
to get back to the home directory.
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 files 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
http://www.piface.
TIP