Saturday, January 10, 2015

A bloke at my local Makerspace decided to build himself a table top arcade machine, which came out pretty damn well!

I had had a similar plan a while back, but never got around to it and so had the buttons and controls on hand which I sold to him. With the build complete and the controls installed, he needed a way to hook the controls up to the MAME PC in the cabinet. I'd been playing around with some Arduino Pro Micro boards for a similar purpose (hooking up retro C64 joysticks to my PC) so these seemed like a really good option. At the current price on eBay of $6.60 from my favourite supplier, this was a really cheap option.

As there were 2 joysticks with 8 buttons each, a single Pro Micro wasn't going to be sufficient, so we used 2. The basic vero board layout was:

2 Joystick Vero board layout

Pretty simple, with just some track cutting to separate the two Pro Micro. Once the tracks were cut we soldered in so 24 pin wide DIP sockets, the end result looked like this:

The wiring to the controls for each Pro Micro was:

PIN

LEFT

RIGHT

2

Up

Up

3

Down

Down

4

Left

Left

5

Right

Right

6

Button 1

Button 1

7

Button 2

Button 2

8

Button 3

Button 3

9

Button 4

Button 4

10

Button 5

Button 5

16

Button 6

Button 6

14

Button 7 (Player 1)

Button 7 (Player 2)

15

Button 8 (Left Paddle or Insert Coin)

Button 8 (Right Paddle or Insert Coin)

Once wired up all we needed was some firmware. The Arduino IDE comes with some basic USB HID support for keyboards and mice, but doesn't feature any joystick HID descriptor. To fix this you'll need to change two files in the core Arduino software: HID.cpp and USBAPI.h. These can be found in the hardware\arduino\cores\arduino for the 1.0.6 build and somewhere similar for the newer IDE builds.