Book Image

Raspberry Pi Gaming - Second Edition

By : Shea Silverman
Book Image

Raspberry Pi Gaming - Second Edition

By: Shea Silverman

Overview of this book

Table of Contents (16 chapters)

Controllers on the Raspberry Pi


Before we begin, you will want to install the joystick package to your device. Type sudo apt-get –y install joystick at the command line and press Enter. The joystick package includes an application called jstest, which will help you identify and troubleshoot your controllers.

When a controller is connected and recognized by the Raspberry Pi, a new entry will be made in the /dev/input/ folder. This folder contains a list of all connected input devices. You should see files like event0, mouse0, and kb0 depending on what has been connected. When your controller is connected, you should see a new item called js0. The 0 at the end of the item indicates the order in which it was connected. You can have multiple items connected, and they will each get an increasing number.

Gamepads

Gamepads are one of the simplest types of controllers for the Raspberry Pi. They can come in different shapes, sizes, and can have different combinations of buttons. These types of controllers...