Interfacing game inputs using the PiFace module
In this task, we will review interfacing the arcade style buttons (shown in the following image) to Raspberry Pi to play the game. In this task, we will just discuss the software part of the code.
We will make use of the PiFace interface board available at http://www.piface.org.uk/products/piface_digital/ to interface these buttons to Raspberry Pi. The board is a stackable add-on hardware that can be used to interface eight inputs and eight outputs. The PiFace comes with four tactile switches and we can get started with testing the inputs.
The main reason behind using the PiFace is that we need to monitor the switch states to determine there is a key press. The PiFace comes with an I/O expansion option and can be accessed through the SPI interface. These features enable simple control of the game inputs.
Prepare for lift off
Raspberry Pi's Serial Peripheral...