Posted on June 29th, 2011 in Androcade, Android, Code, Projects | 11 Comments »
I vividly remember the days of putting my hard earned quarters into the latest video game at the the local arcade (Machine Shed). Disparately tying to get my initials on the high score board, hearing that familiar knock when someone got that extra game on the pinball machine…
Well it’s not the 1980′s anymore and those great games of the past have been replaced by XBox live and mobile handsets.
I’m not one to shy away from the latest in new technology, in fact, I welcome every new piece of techno-wizardry that comes my way. Although, I do miss the look of that retro-joystick and the familiar feel of the plastic button under my fingers. So out of my need to recapture some of my youth (maybe a bit of a stretch) and my love of new technology I set out to create a simple retro gaming controller for the Android platform.
Here’s a video preview of the final project:
I wanted the project to meet a certain set of criteria:
- The controller had to work seamlessly with almost every Android device. This was the biggest hurdle as there is so many different devices to have to support…
- It had to be simple to use. Sometimes easier said than done.
- It had to support a joystick and at least 3 buttons.
Seems simple enough, right?
I started to investigate different ways to build my device. I began my journey down the path of using the Android ADK. This is a great development environment that allows you to use your Android device to interact with physical hardware. It is based on the Arduino which I was already familiar with! After further investigation I found that even though this platform was great it did not meet my needs, for a couple of reasons.
- It needs a physical connection with the device. I wanted to avoid having to plug in the Android device to my controller.
- It needs to be supported by whatever program is running on the Android device. In other words it was not a simple task to send commands to other Android programs using this platform.
So I scrapped the whole ADK idea, but, I did like the idea of using the Arduino for the input device. I already knew how to program it, it was simple to use and provided a great platform to prototype with. So I decided that this was the route to go for interacting with the controller.
My next task was to find a way for the Arduino to communicate with the Android device. After eliminating USB the next logical solution was Bluetooth.
I set out to find a inexpensive shield for the Arduino that would allow bluetooth communication to my Android device. Combing the internet I found several bluetooth shields for the Arduino but, they all cost around $40-$60 and being thrifty (OK – I’ll admit it… I’m cheap!) I wanted a less expensive solution.
After more searching I found what I think is the perfect solution! I found a $20 bluetooth shield that acts as a serial communication device. The product can be found here:
This device will work perfectly for my needs! I would simply send different characters over the serial port from the Arduino to the Android device and interrupt those commands on the Android to control games.
The next thing I had to figure out was how I was going to accept those commands from the bluetooth shield and send them to the games on the Android.
After a little searching and reading I settled upon writing a IME (Input Method Editor) for the Android that would take in the commands over bluetooth and send them out to the system as keyboard commands. This will work perfectly as a lot of the games that I wanted to play supported using the keyboard as an input device!
Read Part 2 of the ANDROCADE build