For those who have the PiFace Control and Display 2 (https://goo.gl/VeBNJw), and want to make it compatible with the ODROID-C2, you have to do some hardware modifications. The modification will help make it functional with the bitbang driver, since the Pifacecad2 needs to switch pins CE0 and CE1.
First, desolder pin number 24 and 26 from the ODROID. Next, solder two wires from the ODROID’s pin 24 and 26 on the Pifacecad and cross them, as shown in Figure 1.
I’ve designed a case for a 3D printer, which is available to download from: https://www.thingiverse.com/thing:2750165.
Using the Debian Odroid-Jessie64 OS, install the Pifacecad library with the following commands:
$ sudo apt install python3-pifacecad git $ git clone https://github.com/piface/pifacecommon.git $ cd pifacecommon/ $ sudo python3 setup.py install $ git clone https://github.com/piface/pifacecad.git $ cd pifacad $ sudo python3 setup.py install
It is necessary to modify the library to work with the ODROID-C2:
$ nano /usr/local/lib/python3.4/dist-packages/pifacecad/__init__.py
I don’t need infrared capabilities, so I commented out the following lines:
#from .ir import ( #IREventListener, #) $ nano /usr/local/lib/python3.4/dist-packages/pifacecad/core.py
Modify the line to select the correct spi device: /dev/spidev0.0 (instead of 0.1 default):
DEFAULT_SPI_CHIP_SELECT = 0 $ nano /usr/local/lib/python3.4/dist-packages/pifacecommon/interrupts.py
Modify theses lines, to replace the Raspberry Pi GPIO 25 with the ODROID GPIO 231:
GPIO_INTERRUPT_PIN = 231 gpio231 = open(GPIO_INTERRUPT_DEVICE_VALUE, 'r') epoll.register(gpio231, select.EPOLLIN | select.EPOLLET)
Also, check if the bitbang is working on the ODROID-C2:
$ lsmod | grep spi
This command will return the SPI drivers loaded by default with Debian:
spidev spi_gpio spi_bitbang
For comments, questions and suggestions, please visit the original forum post at https://forum.odroid.com/viewtopic.php?f=139&t=29496.