Go Down

Topic: USB Game Controller Device (Read 2355 times) previous topic - next topic

vidjogamer

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!

johnwasser

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

vidjogamer

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?

johnwasser


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): http://www.adafruit.com/products/296  Sparkfun has one for $19.95: http://www.sparkfun.com/products/11117

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

vidjogamer

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.

johnwasser


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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

RandallR

I might suggest looking at http://www.pjrc.com/teensy/.   These boards are easy to interface with and are reasonably priced.

vidjogamer

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

Go Up