In my last post, I showed that I could use my homebrew C64 USB keyboard with the iPad using the Camera Connection Kit. What was interesting was when I opened iMAME (you were lucky enough to snag it, right?) and accidentally pressed keys on the keyboard. iMAME said it was enabling iCade mode. I thought this was interesting and looked it up.
iCade connects via Bluetooth and acts as a Bluetooth keyboard. My keyboard was connected via USB. Could a USB keyboard work to control games on the iPad? Maybe the connection type didn’t matter? Could I create an adapter that connects via USB and lets you use standard game controllers in iMAME?
iCade sends key strokes when a button is pressed and once again when it’s released. The keys are documented for developers. I launched iMAME again with the USB keyboard plugged in to confirm and as expected the keys worked to control the games.
The next part was pretty straight forward. Make a USB keyboard with an Arduino (see previous post on how this was done) but instead of an actual keyboard matrix, use a game pad. I chose to use my trusty original NES game pad since they’re so easy to interface with.
I threw together a quick case from LEGO and hot glued in two jacks, one for the NES controller and one for USB. The iPad powers the Arduino and the NES controller so no power supply is needed.
And there you have it, a DIY NES Gamepad to iPad via USB adapter. I’ll post the code later when it’s been cleaned up a bit. The only other game I’ve tested was Atari’s Greatest Hits and it seemed to work fine. In theory, any game that supports the iCade should work.
Some Guy
February 21, 2012 at 3:21pmCouldnt you have just bought one of these?
http://www.amazon.com/Classic-USB-NES-Controller-PC/dp/B002YVD3KM/ref=sr_1_1?ie=UTF8&qid=1329852055&sr=8-1
admin
February 23, 2012 at 9:20pmProbably not. That device will most likely show up as a USB Joystick. The iPad doesn’t know how to talk with those. It does know how to talk with a USB HID Keyboard thus leading to iCade emulation.
SNES-Pad iCade-Adapter | petRockBlog
April 22, 2012 at 8:25am[…] I finished a little do-it-yourself project: Inspired by this biorhythm article, I decided to build my own iCade-gameplay adapter. During the planing stage, I soon realized that […]
oil
July 2, 2012 at 4:46amWaow ! well done ! I wish to connect something like that : http://image.ec21.com/image/cutmukti/oimg_GC03937446_CA03937464/Hori_Real_ARCADE_Pro_3_Joystick_PS3_HRAP_PC_Sanwa_SF4.jpg
If a manufacturer want to build a simple adapter for it ! go on ! A lot of user would be interested !!
SNESDev-RPi: A SNES-Adapter for the Raspberry Pi | petRockBlog
July 4, 2012 at 2:07am[…] be used for connecting SNES controllers to a microcontroller or PC came up when I read about a project, in which an NES controller was connected to an iPad. In previous posts, I wrote about the first […]
Allen Huffman
December 6, 2012 at 4:08pmYour discovery that USB keyboard keys would work with iCade apps led me to buying a $19 Teensy 2.0 and using it to wire up an Atari joystick to my iPad. The Teensy even seem sto be low power enough to run directly off the 20mA provided by the Apple Camera Connector Kit’s USB adapter. Thansk for the inspiration! I had no idea apps were just looking for keypresses (indeed, I can send the iCade keys manually via a Belkin USB keyboard and the iPad apps respond — I had no idea!)
admin
December 9, 2012 at 6:00pmHi Allen, That’s great! The Teensy sounds like a great use of this adapter. Small enough to perhaps fit inside of the Atari joystick? Will you make a writeup and plans?
Yes, the fact that it’s just looking for HID keypresses makes it extremely easy to integrate. I wonder if things will change with the new lightning adapter now on iOS devices..
Also, I have to admit, I did run the Arduino from the iPad’s measley 20mA power supply. I didn’t use it for long, but it did work for testing.