Something I’ve been wanting to do for a while… and something that seemed to interest the students – A Raspberry Pi Arcade Machine!
It’s pretty straightforward but the end result could prove to be rather good. We needed the following:
- Case – some Melamine-faced chipboard left over from a lab refit
- Push-to-make switches – the more the merrier
- Some switch bezels – cut on the CNC router
- An audio amplifier (built from a kit) with two 8Ω loudspeakers
- Speaker bezels – converted from the Raspberry Pi logo and cut on the router
- Raspberry Pi, second-hand LCD monitor, HDMI-VGA adapter.
- Software: Stella Atari Emulator, Scratch, Python and PyGame.
- Python and uinput to handle switches and turn them into keypresses.
In the front of the cabinet I’ve also added a 25mm hole. I’m going to fit a cheap webcam behind here as it’ll be ideal for my ASCII-Selfie machine. I should have got hold of some iron-on edging to tidy up the edges, but time flies like an arrow (and fruit-flies like a banana!).
Behind the ΠrCADE (Pi…R…Cade – geddit?) logo (created by a student) is an LED backlight scavenged from a broken in-car sat-nav device. It lights up whenever there is power, but I intend to connect it via a darlington to one of the GPIO outputs as a little demonstration of output control.
I’m going to write this up fully some other time (and include pictures) but the basic instructions can be found here or here. I had some problems following these, so I’m going to try installing python-pip and follow these instructions. For some reason, the version I downloaded from git didn’t work, so I made a copy of the download from a previous SD card image and then used that, and there were no problems. Either the git version has been updated and isn’t compatible with my SD card image, or something else is a bit wobbly.
The switch inputs are made from ten push-to-make switches wired between a GPIO input and the 0v connection. In the program given in the links above, the inputs each have their pull-up resistors enabled. This means a much simpler set of connections and the whole thing can be created on a scrap of stripboard. The circuit diagram is shown.
The switch circuit is shown here. Any push-to-make switch could be used. A real arcade machine would use large buttons with a microswitch fitted behind the panel, but these are designed to take some serious abuse. I’m hoping that mine will be treated much more nicely.
Another refinement that I ought to do is to make the game match up with the Scratch5GPIO inputs that are defined already. If this was done, then it would be an easy-ish job to convert programs already written to use the keyboard into Scratch Arcade Machine programs.
Another development… Maelstrom is awesome on this machine – especially with the volume cranked up.