Simple web control with PiFace Control And Display

Difficulty: easy

Learn how to control your PiFace Control And Display using a browser from any computer on your local network.

Getting started with simple web control for PiFace Control And Display

To control your PiFace Control And Display (CAD) from a browser, first login into your Raspberry Pi with your PiFace CAD connected, then open a Terminal and enter the command:
git clone
Move into this directory: cd 9620246
And run the file inside: python3
This will start a simple web server for you to access.

Viewing the PiFace Digital's state

Open a browser on your Pi or another computer on your network, and enter the following address into the address bar:
The browser will return the state of the switches, LCD text and cursor position

Note: Replace with your Pi's ip address. Hint, it will have been printed out when you started the web server.

Writing to PiFace CAD

You can set the LCD text of PiFace CAD by adding the following line to the end of the address:
So the full command will be:

Web command in browser for writing <i>Hello</i> to PiFace CAD's LCD screen
Web command in browser for writing Hello to PiFace CAD's LCD screen
This text will appear on your PiFace CAD LCD screen.

Other web PiFace CAD commands

To control other aspects of your PiFace CAD, such as the backlight, enter the following into the browser:

Try these: Replace backlight_on in the previous instruction with one of the following: