Book Image

Raspberry Pi Blueprints

Book Image

Raspberry Pi Blueprints

Overview of this book

Table of Contents (17 chapters)
Raspberry Pi Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using the buttons and joystick with PiPlay


While the ability to use GPIO inputs as input to emulators is planned for a future release of PiPlay, the current version does not support the use of switches connected via the GPIO port as input to game emulators. Hence, we need an additional piece of software to do this.

Fortunately, Adafruit has already written a driver that converts switch signals from the GPIO port to key presses (https://github.com/adafruit/Adafruit-Retrogame), which we will use for our arcade buttons and joystick.

First, we need to install some required programs and libraries that will allow us to recompile the retro game software when we make changes to it; these can be installed using:

sudo apt-get install git libexpat1 libexpat1-dev libncurses5 libncurses5-dev

Next, we will download the retro game software and move to the directory it was saved in by using the following two commands:

git clone https://github.com/adafruit/Adafruit-Retrogame.git
cd Adafruit-Retrogame

While...