Using PiFace Control And Display emulator

Difficulty: beginner

How to install and use the PiFace Control And Display emulator in a number of different ways.

Install PiFace Control And Display emulator

The PiFace CAD emulator allows you to use CAD methods in your projects when you haven't got a PiFace CAD board handy.

To install the emulator, open a Terminal and update your Raspberry Pi's package lists using the command
sudo apt-get update

Now install the PiFace CAD emulator package by typing
sudo apt-get install python3-pifacecad-emulator

Enter y when instructed.

Now that the emulator is installed, to use it you must be in the graphical environment, if you are not, enter the command
startx

To start the emulator you can either click the desktop icon PiFace CAD Emulator or open a Terminal and enter
pifacecad-emulator

You will see the emulator appear on your screen

PiFace Control And Display emulator on startup
PiFace Control And Display emulator on startup

You can also use the emulator in a python shell or program
import pifacecad_emulator as p cad = p.PiFaceCAD()

Then you can use the cad object as you would do normally.

cad.lcd.backlight_on()
cad.lcd.write(“Hello”) print (cad.switches[0].value)