Pages: [1]   Go Down
Author Topic: USB Game Controller Device  (Read 1904 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 203
Posts: 8720
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 203
Posts: 8720
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 203
Posts: 8720
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Offline Offline
Sr. Member
****
Karma: 1
Posts: 322
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: