Using PiFace Control And Display random number generator

Difficulty: easy

How to turn your PiFace Control And Display into a random number generator.

Running PiFace Control And Display random number display

  • This guide will show you how to turn your PiFace CAD into a random number generator. First download the randomCAD files from github by opening a Terminal and typing
    git clone https://github.com/thomasmacpherson/randomCAD.git

  • Move into the newly created folder
    cd randomCAD

  • Run randomCAD with the command
    python3 randomCAD.py

    You will see the PiFace CAD's backlight come on and text saying "Random number from 000 > 000→"

    PiFace CAD randomCAD waiting for a number range
    PiFace CAD randomCAD waiting for a number range
  • Flick the rocker switch to select the number in the range you wish to change, once there press in the rocker switch and flick it to the number you want. To accept this number press in the rocker switch again. Repeat this until you have set the range of your random number, eg:256 > 512. Then flick the rocker switch so the cursor is under the . Press in the switch a final time and your random number will appear on the second line of the LCD screen.

    PiFace CAD displaying a random number from a set range
    PiFace CAD displaying a random number from a set range
  • To generate a new random number from the same range, press in the leftmost button on the PiFace CAD.
  • To set a new range, press the 2nd button from the left.
  • To exit, hold down the rightmost button.