First commands with PiFace Control And Display

With your PiFace CAD installed, fitted and tested, it is time to control PiFace CAD through Python

Type the following python code in either a python shell or as a python program.
import pifacecad as p
cad = p.PiFaceCAD()
This will import and initialise the PiFace CAD module.

Now try turning the LCD backlight on
cad.lcd.backlight_on()
And off
cad.lcd.backlight_off()

Writing to the screen is just as simple.
cad.lcd.write("Your text")

To remove this text enter the following
cad.lcd.clear()

Now have a go at reading the buttons
print(cad.switches[4].value)
If you are not touching the button it should return 0

Now hold the fifth button (the one set slightly away from the other four) down and run the above command again, it should now return 1

View PiFace CAD's full documentation for more examples and commands.