Using PiFace Control And Display for currency conversion

Difficulty: easy

How to install, customise and use the currencyCAD example for PiFace Control And Display.

Running PiFace Control And Display currency converter

Currency CAD requires an Internet connection to work.

To turn your PiFace CAD into a currency converter, first open a Terminal and type
git clone https://github.com/thomasmacpherson/currencyCAD.git

This will download the latest currencyCAD files into a folder called currencyCAD in your home directory

To run currency cad, in your Terminal window, move into the directory you cloned from github.
cd currencyCAD

Now run the python file
python3 currencyCAD.py

Your PiFace CAD LCD screen will now ask whether to load presets, answer this question by flicking the rocker switch to the answer you want (YES or NO), and then pressing in the rocker switch. Presets are the list of paired currencies, pulled from the currencyPairs file.

PiFace CAD display CurrencyCAD load presets menu
PiFace CAD display CurrencyCAD load presets menu

  • Don't load presets- Enter an amount by moving the cursor with the rocker switch to the place value you want to change, then press in the rocker switch, a cursor block will now be blinking. Use the rocker switch to set this number and press it in again to enter the number. Change any more place values you want, then flick the cursor over to the text AED. Press in the rocker switch and cycle to the currency you want to convert from, and press in to enter it. Repeat this for the currency you want to convert to, then move the cursor to the and press in the switch again. After a couple of seconds, the result will appear on the second line of the LCD. To save this currency pair to file, press in the second button from the left, the second line of the LCD will display Pair saved. To request a new conversion, press the first button in the row of 5, to exit press the fifth button.
    You must not leave the amount blank or have the to and from currencies as the same currency

  • Load presets - Enter an amount by moving the cursor with the rocker switch to the place value you want to change, then press in the rocker switch, a cursor block will now be blinking. Use the rocker switch to set this number and press it in again to enter the number. Change any more place values you want, then flick the cursor over to the text JPY>GBP. Press in the rocker switch and cycle through the preset currency pairs, press in the switch when you have found the one you want. Now flick the cursor over to the arrow and press in the switch again. After a couple of seconds, the result will appear on the second line of the LCD. To request a new conversion, press the first button in the row of 5, to exit press the fifth button.

CurrencyCAD displaying a successful conversion
CurrencyCAD displaying a successful conversion"

Google finance currency converter (which currencyCAD pulls it's conversion from) will not convert some pairs of currencies. This will display as "Google cant conv those currencies" on the LCD and the program shall exit.

PiFace CAD displaying can't convert error message

PiFace CAD displaying can't convert error message

If you want to remove our default preset currencies or change the order of currency pairs, then navigate to the currencyCAD folder you cloned from github and open the currencyPairs file with your favourite text editor, eg
leafpad currencyPairs
Make the changes you want to the file and Save it.