Setting up the PiFace Digital with Raspbian/Minibian

pifaceUnconnectedThe PiFace Digital is an I/O expansion board for the Raspberry Pi. It has to be installed by plugging it on to the GPIO of the Raspberry Pi. The PiFace website has its own guide which tells you how to set up the PiFace. I’d also like to provide you with my own guide to do this on Raspbian or Minibian.

Before proceeding, you should make sure you have executed step 2 and 3 of my first steps guide for Minibian. If you are logged in as an account other than the root account, you should add “sudo” in front of all of the commands described in the guide. If you are running Raspbian with a desktop environment, you have to open a command-line terminal window first.

Before you proceed, make sure you have at least 1GB (for Minibian) of free space on your /dev/root partition, as you will be installing a fairly large amount of sofware! You can check this by running “df -h“. It is possible that you have to install less software if you are running a Raspbian image rather than Minibian, as it might already come with some of the software pre-installed.

Next you will need to install the required software to use the PiFace Digital. Run the command “sudo apt-get install raspi-config python3-pifacedigital-emulator“. If you intend to use the Scratch application on your desktop environment, also execute “sudo apt-get install python3-pifacedigital-scratch-handler“. To allow you to use the SPI (Serial Peripheral Interface), which the PiFace is connected to, you will need to enable it in the device’s configuration. Do this by executing “sudo raspi-config“, in the interface which should now be showing, select option 8 “Advanced Options“. Next select option A5 “SPI“. Next press “<Yes>“, “<Ok>” and finally “<Finish>” to exit. (You can select the buttons by using the TAB key.) You will now be prompted to reboot the device, you should do this, so either select “<Yes>” or select “<No>” and execute “reboot“.

Now you will want to test if the setup was successful. To do so, you can execute a sample script by running “python3 /usr/share/doc/python3-pifacedigitalio/examples/blink.py“. You should now see LED7 on the PiFace board slowly blink. You can stop the blinking by stopping the program (with the key combination Ctrl+C).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.