In preparation for some Maker Faire's we were heading to last year, I wanted to combine the awesomeness of the Makey Makey platform, with the fun that is RetroPie. For those who don't know the Makey Makey, it's a fantastic platform that allows you to connect the pin of an Atmega32u4 microcontroller up to the world around you. Fruit, vegetables, people, graphite, play dough, anything as long as it's somewhat conductive. It then outputs keyboard and mouse commands over USB which is perfect for connecting to the USB ports on a Raspberry Pi! So we modified some of the Makey Makey code (oh yeah, it's Arduino compatible) and got it all up and running.
I'm using the Makey Makey gamepad to control a RetroPie setup, however, it will also work on your computer or any other device that accepts a USB controller.
First of all, let's take a look at what you'll need in order to get your RetroPie setup running. RetroPie is an operating system for the Raspberry Pi which allows you to run ROMs on almost any vintage gaming emulator. It takes care of all the hard work, and you just have to load your ROMs onto it. The best way to get started is with one of the RetroPie Gaming Kits for NES/SNES. If you don't already have a Raspberry Pi, then they're perfect, however, if you do already have a Raspberry Pi, here's a complete list of what you'll need:
- Raspberry Pi 3 board (any Pi will work, but a Pi 3 is the best because of the newer specs)
- Raspberry Pi 5V 2.5A microUSB power supply
- microSD card with RetroPie
- HDMI display/screen and an HDMI cable
- USB controller (keyboard or gamepad)
- A sweet case (optional, but it will help keep your Pi safe)
And to create your own Makey Makey controller you'll need:
- Makey Makey Starter Kit
- Some fruit and veggies (or whatever other objects you want to use as buttons)
- 5V power supply that you can connect a USB cable to (a phone charger unit or computer USB port works well) A computer to reprogram your Makey Makey (optional, for capacitive touch)
Setting up RetroPie
It helps to power up your Pi and get it setup first before connecting a Makey Makey up. So first connect an HDMI cable to your Pi and the display. and then insert the microSD card into the card reader on the Pi. Then, connect your USB device up to any of the 4 USB ports on the Pi and then connect the microUSB power supply. You should see the Red power light come on, and the Green SD status light blink randomly.
After a few moments of booting up, it will bring you to the input config page if it's the first time the SD card has been booted up. From here, you want to map the buttons on your controller to the corresponding buttons on the screen. Bear in mind that your controller most likely won't have as many buttons as there are options on the screen. To skip those, hold any button in for a second or two (use a button you've already mapped, as accidently mapping the wrong button means redoing the whole mapping process).
For example, if you were using a SNES style controller this is what your mapping would look like:
Go ahead and map your controller buttons. Now that you've got a controller setup and ready to go, you'll want some ROMs to play. Loading ROMs onto your RetroPie is covered in the Gaming Kit for RetroPie tutorial, so check out all the info there.
Now that the RetroPie system is up and running, let's take a look at using the Makey Makey!
Setting up Makey Makey
Now comes the fun part, setting up the Makey Makey gamepad. There are two ways to use a Makey Makey, with the standard configuration of resistive touch which requires your to create a complete circuit to ground (meaning you have to hold a ground wire the whole time), or capacitive touch, which allows you to just touch a single wire without having to hold a ground wire (requires reprogramming the Makey Makey, but it's super easy). You can use whatever method you prefer, however, if you are interested in using the capacitive touch, it results in a much more rewarding setup and is quite easy to do. Follow the tutorial on Capacitive Touch with Makey Makey which provides all the code and instructions necessary. Now let's hook up some buttons!
Connecting things to the inputs of the Makey Makey is as easy as taking the alligator clips, connecting them to the large pads on the top of the board, and then clipping them to your button.
You can connect them in whatever layout you like, however, I chose to create the layout of a NES controller:
However, I ran out of the large pads on the top of the board to connect the select and start buttons. So I soldered two extra jumper wires straight to the keyboard input headers on the underside and fed them through the spare ground holes for strain relief (you don't have to solder, but I wanted to keep a low profile rather than have them stick out):
Now whether or not you've got your Makey Makey programmed for standard resistive touch, or capacitive touch, when you touch one of the buttons (holding the ground wire if you're using resistive touch), you should see the LED on the board light up. Double check every button and now we're ready to configure it as a gamepad for RetroPie.
Launch RetroPie and press the START button on the controller you've already configured, then scroll down to 'Configure Input'. This will open up the same input configuration screen we used before, except this time you can use the inputs on your Makey Makey! Remember that you may have to adjust the sensitivity of the inputs for different types of fruit/veg/material used (see the capacitive touch tutorial linked to above for more info).
And that's all there is to it. It's pretty easy and most of the work is already done. If you do this project, post some pictures of your setup to help inspire creativity for others.