Page 1 of 1

Arduino Pro Mini Game Controller

Posted: Tue Jul 03, 2012 9:47 pm
by Amanoo
Hello. I just got forwarded to this place while I was trying to figure out how to make a controller using Arduino. As I understand, the Arduino should be compatible with this project, but I'm not quite able to put together all of the loose ends. What I am trying to do is simply to make a USB game controller with my Arduino Pro Mini, using spare parts like small joysticks and buttons. I need the system to work plug-and-play and be immediately recognised as a game controller. I do not know anything about microcontrollers that doesn't directly involve Arduinos. Can anyone help me get started?

Re: Arduino Pro Mini Game Controller

Posted: Mon Jul 23, 2012 6:15 pm
by ulao
Arduino is a dev board that uses the atmega 168 chip. That project also supports that chip. That is the only similarity there is that I know of. What type of controller to you want to make? There are a lot of projects that use v-usb for game controllers. Here is the most complete one you will find.
http://bliss-box.net/

See the projects page for others.

Re: Arduino Pro Mini Game Controller

Posted: Mon Jul 23, 2012 6:24 pm
by Amanoo
Well, I just want your basic Playstation/Xbox sort of controller. Your link is really for a full pre-assembled system, thus more expensive than I need. I already should have the parts I need to make my own controller. I haven't looked into the other reaction yet, since the only Arduino currently available to me is my mini. I'm still waiting for another that has breadboard plugs. My Uno3 is currently occupied, and I'd much rather wait soldering things to my pro mini until I can test it first.

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 1:55 am
by ulao
Ps3 is usb already, so is xbox and sbox 360 you dont need to make an adapter?

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 2:03 am
by Amanoo
Problem is that those have their own shapes and designs. I want to put my mobile phone in the controller, and use it to play games on the phone. I need to define my own shape, and I can't use the preshaped controllers and the boards that are inside them (which are shaped similarly to the controller). I need the USB support because my phone has a USB host function. Anything compatible with USB on a PC is compatible with my phone.

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 5:09 am
by ulao
I dont understand this shape business. Though if your phone supports usb then consider this.
1) Xbox will not work. In order to use the xbox you need to make a hacked driver. Triing to decode a xbox is the same thing as decoding a usb protocol and that my friend is no easy task.
2) its more then likely android or i os and I dont think HID are supported.

Now the xbox 360 and the ps3 both work as usb device but with a driver for them to work on a PC. I can easily see why that is going to be impossible on a phone.

So you would need to do this ( declaimer Even hanging 10 years experiences with this project and avr chips I would never try this ).

ps3 controller -> MCU_1 -> MCU_20 -> usb

So you need to first make the MCU_1. This chip will need to decode the USB protocol and push the information in to a shift register of sorts. MCU_2 will read this register and push that to v-usb.

MCU_2 is simple. The one that will take you 5 to ten years ( assuming you are new to this ) is the MCU_1. So I ask you now, is it worth it?


Here is a project that I believe will read a usb protocol.
https://courses.cit.cornell.edu/ee476/F ... index.html

I also want to point out much of this is cake walk with any other controllers. for example a ps2 is way more simple to read. There are also hundreds of people that host there work that do that very thing. Lots of people do it on v-usb like me. The xbox and ps3 are the beasts. If your phone supports HID that I could show you exactly what to do. Though phones are meant to use HID AFAIK. Is this a tablet ?

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 1:13 pm
by Amanoo
It is a Galaxy S3, which to my knowledge does support HID. I already tried connecting a USB controller and a mouse I had lying around to it, and they worked. My Xbox 360 Guitar Hero controller (don't have any other 360 items lying around, I use this one for PC) indeed didn't work. You need a converter cable for this, though, but I have one of them, so that's okay. It even supports USB hubs (I saw someone doing something really ridiculous using that). What I'm planning to build is something like this: http://www.itechnews.net/wp-content/upl ... roller.jpg . This controller most likely works through bluetooth, though, which has additional power draw and all of that.

I don't know if what you're talking about is useful for this project, but I'm starting to get intrigued. I don't know what MCU_1 and MCU_2 are, but if MCU_1 is that hard, I guess it's a nuh-uh. I do have A Playstation 2 controller lying around that I don't use, and I'm rather starting to get rather curious.

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 3:56 pm
by ulao
I would not use blue tooth. If it were me I'd just wire up a ps2 to usb and be done with it. If that works you an move on to something more complicated.

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 4:19 pm
by Amanoo
Yeah, i don't feel much for using bluetooth. That is where this whole topic began. I'm starting to think, what the heck. I do have a phone holder that you can use to attach the phone to a camera tripod. I could modify the PS2 controller and attach the holder to it. That way I would still have the idea of a controller that I can put my phone into. Still need to figure out. I did manage to gather the following on the Arduino forum not too long ago: http://www.practicalarduino.com/project ... b-keyboard
I have one that was a mod of that keyboard lib made for .16 and I patched it up for .18, and I have no idea if it compiles on 1.0 or not, but it will compile on .18 and should on .22

original
http://www.arduino.nl/?p=36

my .18 fix
http://www.instructables.com/files/orig ... TU1ULB.zip

yea it says NES, but in windows its 4 buttons, 2axis analog joystick, and 4 additional analog axis (for another joystick or flight controls like rudder and whatnot)

here is a precompiled version for a 16mhz atmega318P using the same wiring to usb as the keyboard thing you linked to
(right click save as)
http://www.instructables.com/files/orig ... TU1UKW.tmp

otherwise I hate USB and this is really over my head, but thats what I got

So that should give me a V-USB based Joystick library and a schematic to USB so that I can use my Arduino. My initial idea was to create my own controller, thus hook up all buttons to the digital pins of the Arduino and the joysticks to the analog pins. If I am to convert the PS2 controller to USB using this, I would need to do some additional interpretation. I strongly prefer using Arduino, since it is a relatively easy microcontroller (and I have no experience with microcontrollers apart from Arduino whatsoever, Arduinos are even the only ones I own) and I should have all, or at least most of the, required parts if I am to use Arduino. I don't feel much for buying completely new stuff. I was planning to toy a bit around soon, but I need another Arduino for that (the Pro Mini doesn't have breadboard plugs, and my Uno3 is currently occupied). The third Arduino has yet to arrive in the mail.

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 5:20 pm
by ulao
Arduinos ?
http://www.obdev.at/products/vusb/prjhid.html
OH my, you dont have to get that involved here. Just grab a project. PS2USB is one that I used a few time. Will allow two controllers. This will cost you $5 total + a box to make.
I sell ready made ps2 adapters for $35, you dont need to buy an over bloated Arduino .

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 6:12 pm
by Amanoo
But VUSB has to be loaded on a microcontroller, right?
I already have a small Arduino ready, so i really don't feel much for buying anything else.

Re: Arduino Pro Mini Game Controller

Posted: Tue Jul 24, 2012 6:54 pm
by ulao
yeah, but you just flash it. Its a lot faster then trying to do all this on the Arduino board. They dont come with ps2 code, so you need to write it. Atmega chips by them selves can have a bootloader on it so you can program via usb if that is your issue. But an ISP programmer is a good buy if your in to this stuff. Also Arduinos have zero to do with v-usb. So there is little more we can do to help you.