USB Game Controller Device

Hi guys. I'm a sofware engineer just getting into hardware and electronics. I want to make a simple USB game controller. I was hoping someone could maybe point me in the right direction on how to do this. I've done some searching for how to hack USB devices but havent found anything useful. Mostly the results are just powering devices-- not sending/receiving data. Any help is very much appreciated. Thanks!

Game controllers come under the heading of Human Interface Devices (HID). If you get an Arduino Leonardo you can use the standard libraries to make it act as a USB HID. See File->Examples->09.USB(Leonardo) for some examples.

You can similarly do that sort of thing with the USB-to-Serial chip on the Arduino UNO but it's much harder.

Thank you for your response.

I have already purchased an UNO. Would it be feasible to purchase only the ATmega32u4, rather than purchasing a Leonardo?

vidjogamer:
I have already purchased an UNO. Would it be feasible to purchase only the ATmega32u4, rather than purchasing a Leonardo?

If you mean "install an ATmega32u4 in place of the ATmega328P on the Arduino UNO", then no. The 32u4 doesn't come in a 28-pin DIP package so it will not fit in the Arduino UNO socket.

If you mean "build a Leonardo clone using a bare processor" then that is possible. Since it only comes in surface-mount form you won't be able to plug one into a breadboard. You will probably want to get a breakout board for it. Adafruit has one for $19.90 (about $0.10 less than a Leonardo): Atmega32u4 Breakout Board : ID 296 : Adafruit Industries, Unique & fun DIY electronics and kits Sparkfun has one for $19.95: SparkFun ATMEGA32U4 Breakout - DEV-11117 - SparkFun Electronics

What I meant was program the chip and use it independent of the arduino. Is that possible?

I looked at the examples. There are keyboard and mouse examples. Is there a way to get the host OS to recognize the device as a Game Controller/Joystick?

Thanks again.

vidjogamer:
What I meant was program the chip and use it independent of the arduino. Is that possible?

Yes, it is possible if you provide power, crystal, and some other support circuitry. The hard part is making connections to the tiny pins of an SMD. If you don't want to buy an existing breakout board you will probably have to design a custom circuit board of your own and learn surface-mount soldering techniques.

I might suggest looking at Teensy USB Development Board. These boards are easy to interface with and are reasonably priced.

Thank you both. I'll look into your suggestions! =)