It’s been a long week, and I am really glad I have a long weekend to sleep in.
When the Arduino Leonardo was announced I was really excited to see it have built in USB HID support and could act as a keyboard, mouse, or joystick. I was even more excited to find out that my year old Teensy++ (Arduino compatible board) was based on the same chipset that the Leonardo now uses, and is able to act as a keyboard as well!
This is a new feature that was introduced in the Arduino 1.0 IDE. You can now send keyboard presses with this simple line of code: Keyboard.write(‘a’); If I wanted the Up joystick to be the up arrow on the keyboard, I would just use: Keyboard.write(0x0E); .
My goal is to use my Neo Geo AES controllers as an input for MAME. The Neo Geo pads don’t have any control boards built into the unit. The console itself interprets each pin individually, just like an actual arcade board. The pad uses a standard midi gameport (DA-15) connector, with each pin representing one button.
My idea is to make a Neo Geo pad to usb adapter using the Teensy++ as go-between. The Neo Geo pins will be wired up to the digital pins on the Teensy, and the Teensy Arduino sketch will interpret each button press as a keyboard press.
I’m looking forward to working on this project. I hope everyone has a great weekend and a restful Labor Day.
I almost went the USB keyboard emulation route myself when I was working on my MAME cab, but it was pointed out to me that USB keyboards only allow 6 simultaneous keypresses by default (unless you’re very careful about which keys are being mapped…), so I changed gears and went with another Arduino-based method that directly emulates joypads. It’s actually super easy to emulate X number of joypads with Y buttons with some of these projects out there. Check out my page for how I went about it if you’re curious, but basically I used a small AVR with a bunch of shift registers, and it works great.
I’m using a teensy++ for my keyboard emulation. It’s basically an Arduino Leonardo with a lot more capabilities. PJRC.com develops and produces them.
Do you have any code samples ? I have tried using my Leonardo as a arcade joystick -> USB keyboard and while it works in notepad and i can see the key presses, MAME does not like it. I may get the odd response to the fire button but that’s about it.