Blockade (Raspberry Pi powered Lego/Blox) Bartop Arcade Machine

14/1/17

Attached my Picade Hat to my Raspberry Pi and wired up the joystick and buttons.

Follwed the manufacturers installation guide here:

Getting Started with Picade HAT

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.

Connecting the “action” buttons

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.

Connecting the “utility” 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.

Connecting the joystick

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):

  • yellow to bottom right
  • orange to top left
  • red to top right
  • brown to bottom left

Then, take the spade connectors of the black ground wire and connect one to each of the remaining terminals.

Connecting the speaker

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 -.

Connecting the power supply

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.

Installing the software

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.

At this point I pushed the new soft power button and the system booted into RetroPie and I went to the menu for configuring the controls but RetroPie seemingly could not see the new controls. After a few quick checks for loose wires I posted a meesage on the Pimoroni Support Fourm and received some quick replies. See below for the message trails.

Picade HAT not working

Received my new Picade hat today and followed the setup instructions on a retropie image that was already being used. Wired up the controls and when I push the soft power button, the system boots to retropie. I go to the controls setup and the buttons and joystick are not seen and cannot be configured. The soft power button also will not shut down the system and this has to be done the usual way with a keyboard command.

Also purchased a Picade pcb (not hat) and connected this and this works straight away with the same retropie image.

Any suggestions would be very welcome as this is going into a bartop arcade machine made from lego that I hope to show off at an event on Wednesday.

Reply

Which setup instructions did you follow?

Do you have a mouse/keyboard attached to your Pi that you can run some debugging steps with?

Reply

Can you hit F4 to drop to the command line and see what you get if you run:

cat /var/log/picadehatd.log

You should see something like; “Picade HAT daemon running…”

Next try running the showkey command to see if it shows anything when you press a key.

Reply

 

cat /var/log/picadehatd.log
no such file or directory

showkey
press any key (I tried presses button and joystick)
no output
keycode 28 release for 10 seconds that exits

Reply

I received my Picade hat this week as well and I do experience exactly the same issue…
I’m following your track and getting the same messages…
See how I set it up, if it can help:

Reply

Curious, sounds like the software isn’t running at all.

Could you try running: sudo picadehatd

1 Reply

Reply

It says “command not found”

Reply

Then you have no working software at all… can you run the setup.sh found in the repo and post the full output here?

Reply

IE:

git clone https://github.com/pimoroni/picade-hat
cd picade-hat
./setup.sh

Reply

actually, there should already be a clone of the repo in ~/Pimoroni/… if not that’s the problem right there!

Reply

I think the most likely is that the install went fine but the file is not executable, try (+reboot):

sudo chmod +x /usr/bin/picadehatd

Reply

Great! It works for me now! Can map the buttons and stick now!
Hope this is solve for kryten as well.

Reply

it should, hopefully. It seems that editing files live in the repo using github directly messes file modes. The setup.sh now takes some steps to avoid running into that pitfall again, sorry about the false start. Enjoy!

Reply

Thanks! Enjoying it now!

Reply

Thanks everyone. That’s working fine now. I really appreciate your help and am looking forward to completing the project now.

I am going to finish wiring up all controls and then when I get to work tomorrow morning, fit them inside the lego case. When it’s complete, I will try to post some pics of what you helped to create.

 

Parts List

B&Q 30 mm Holesaw £7.02

B&Q Arbor £4.97

4 x tubs Wilkinsons 2×4 blocks £14.00

15/1/17

Went to B&Q to purchase tools for cutting 30mm holes into the lego plates to fit the arcade controls.

Used these latest blocks to build a temporary lego home for the joystick and buttons for setup and testing purposes.

Wired up all the controls to the Picade Hat. Switched on and tried some games

Note – many games not working with default settings and will need further configuration to get working.