Here, we'll learn how to connect up all of the buttons, the joystick, and install the software for Picade HAT. This tutorial uses the parts from the Picade HAT parts kit, but will work equally well with other buttons/joysticks.
Picade HAT has screw terminals for a joystick (up, down, left, right, 6 A/B/X/Y/etc buttons, and 5 utility buttons, one of which is a power button. There are also 3 screw terminals for the ground wires for the joystick, buttons, and utility buttons, which are common grounds that daisy-chain between several buttons/switches.
There is also a pair of screw terminals for a speaker, driven by the 3W mono amplifier and I2S DAC on Picade HAT.
If you have the parts kits, then you won't need to solder anything, you'll just need a screwdriver to screw the wires into the screw terminals.
Picade HAT provides power to your Pi through the GPIO pins so instead of plugging your microUSB power supply into your Pi, as you normally would, you plug it into the microUSB port on Picade HAT. This enables the power on and safe shutdown functionality, where you tap the button connected to the power screw terminal and you Pi switches on, and you tap and hold for at least three seconds to trigger a safe shutdown.
We'll begin by connecting the 6 buttons to the screw terminals on Picade HAT marked 6, 5, 4, 3, 2, 1, ground. Use the wiring loom with the blue, green, yellow, orange, red, brown, and black wires.
You'll see that the black wire has a daisy-chain with 6 spade connectors on; these are the ground wires and they daisy-chain all of the grounds on the 6 buttons back to the single ground terminal on Picade HAT.
Take the bare ends of the wires (the ends without the spade connectors) and separate the wires a little to give you a bit of slack to play with. Push the ends of the wires into the terminal and screw so that the wires are held tight. Begin by attaching the blue wire to terminal 6 and work all the way along until the black ground wire is screwed into the terminal marked with the ground symbol.
Install your buttons wherever they are going, in your arcade cabinet for example, and then connect each of the spade connectors at the other ends of the coloured wires to one of the coloured buttons. We provide 6 coloured buttons for these "action" buttons and 5 black buttons for the "utility" buttons like start, select, etc.
Next, take the black ground wire and connect one of the spade connectors to each of your 6 buttons.
Next, we'll connect the 5 utility buttons. You should have 5 black buttons left for this. Use the two wiring looms with the purple, grey, and white wires, and the black daisy-chained ground wire. Because there are 6 wires provided for these buttons and just 5 terminals, you can strip off one of the coloured wires and snip off the spade connector at the end of the chain, or just wrap the ends with a little bit of insulating tape to prevent any shorts.
Screw the bare ends of the coloured wires into the 5 terminals marked with the power symbol, ENT, ESC, 1/4, and 1UP. Screw the bare end of the black ground wire into the terminal marked with the ground symbol next to these "utility" buttons.
Now, connect the spade connectors on the other ends of the coloured wires to your 5 black buttons, and then connect the grounds up as we did with the 6 "action" buttons.
The joystick has 4 switches - one each for up, down, left, and right - and each switch has a positive and a ground spade connector. If you're holding the joystick with the underside facing you, as in the picture below, the up switch is at the bottom right corner, down at the top left corner, right at the top right corner, and left at the bottom left corner.
First, as we did for the buttons, we'll attach the bare ends of the wires (the ends without the spade connectors) for the joystick to the screw terminals marked JOYSTICK U, D, R, L, and ground on the Picade PCB.
Use the wiring loom with the yellow, orange, red, brown, and black wires. As with the 6 "action" buttons, the black wire is the common ground and will daisy-chain between the ground terminals on the 4 switches on the joystick.
Take the wiring loom with the yellow wire on the left hand side and the black ground wire on the right hand side and screw each wire into the terminals marked U, D, R, L, and ground respectively.
Next, take the spade terminal wire ends and connect them as follows (assuming you're holding the joystick as described above; it doesn't matter with of the two spade connectors you connect to on each switch):
Then, take the spade connectors of the black ground wire and connect one to each of the remaining terminals.
The speaker comes with a red positive and black ground wire pre-soldered. Screw these securely into the two terminals marked SPKR, the red into + and the black into -.
Plug your microUSB power supply (we recommend a black 2.5A official Raspberry Pi power supply) into the microUSB port on Picade HAT, as shown below.
The Picade HAT software does several jobs: i) it emulates key presses when a button is pressed or the joystick is moved, ii) it pushes sound out through Picade HAT's I2S DAC/amp. and, iii) it watches for the power button being held for 3 seconds or more and then triggers a safe shutdown and completely cuts power to your Pi.
Retropie, our OS of choice for retro game emulation, will detect your buttons and joystick as a keyboard input device, but you'll need a USB keyboard connected to install the Picade HAT software initially.
Because we need an internet connection to install the Picade HAT software, we'll need to connect to your WiFi network. Start up Retropie and select "WIFI" in the Retropie menu, and then follow the instructions to connect to your WiFi network.
To install the software, exit to the terminal by pressing start and then selecting "QUIT" and then "QUIT EMULATIONSTATION" (start is mapped to "c" and select is mapped to "control").
Now type the following, pressing "y" or "n" if prompted:
curl -sS https://get.pimoroni.com/picadehat | bash
Reboot your Pi by typing "sudo reboot" and, once back in emulationstation, bring up the menu by pressing "c" on your keyboard and the arrow keys to move down to "CONFIGURE INPUT" and press "control" to select). Now follow the instructions to set the joystick and buttons up as you wish. Bear in mind that you won't be able to set the power button up as a regular button.
Need something for this project? You can use the links below to add products to your Pimoroni Shop basket for easy checkout.
HAT & Parts Kit £45.00
HAT only £15.00
Raspberry Pi 3 Only
Official Raspberry Pi Universal Power Supply