skullriot:
Wow, thanks for the info. That looks intense. I haven't done too much research into what I want to do, but now it seems I have a scope. It's too bad you cant build something into a wireless controller instead of effectively wiring the pcb into a whole setup.
Technically, you could do the same with a wireless, as long as you supply power to the Arduino separately. So, if you include a 9v battery in your Arduino/shield then you could do it without being tethered.
In my case, however, I will often be leaving the console unattended for hours while it grinds away at the tasks, so encountering a low/dead battery would be likely problem. Having the controller hooked up, either using a wired controller or a wireless one with a Plug-N-Play cable avoids the dead battery problem, and both have 5v via the USB cable.
CraigKC:
It looks like you've done some impressive work here! I hate to have only seen this now to let you know this - there are different types of Xbox 360 controllers. They make matrix as well as common ground models. For this type of hacking i certainly presume the CG models would have been substantially easier to work with. If I'm not mistaken they have only produced the CG type for the last couple years and only the oldest controllers are matrix.
I haven't personally interfaced one with Arduino yet but because of my other controller mod experience i learned this and wanted to post the info for anyone else that would run across this thread. The PCBs are distinct and their type easily identified with the help of google in the future.
I was working with what I had handy. Sadly, the wired controller was a matrix one. I do, however, have several wireless controllers. So when I started working on the wireless version I did indeed pick a CG (common ground) version, which cut the number of wires needed in half.
See the links in the original post to a site that has high resolution scans of the various circuit boards (with all chips/parts removed).
rboyd:
If I'm reading your post correctly, it sounds like you are currently programming the macro sequence offline. Do you have any thoughts on record/playback functionality of macros during actual gameplay? Would we need to sample the analog inputs at some frequency?
Yes. I have had thoughts about it. And, one could probably use the exact same pins/wires. However, I don't know how one would go about doing it. In the matrix configuration the voltage varied greatly between points (less than 1v to more than 3v) so it could be tricky to get a reading without interfering with the normal functionality of the controller.
However, if you were willing to gut the controller (i.e. it would no longer function normally on its own), you could permanently re-route the buttons directly to the Arduino, and then use the Arduino to send the signals to the controller PCB. There may be a little 'lag' introduced depending on how tight your sketch is. However, you would be able to see (and log) all of the button presses. Possibly having a 'record' mode and a 'playback' mode (and possibly a toggle switch for 'loop' mode). Course, that means you would need 24 inputs and 24 outputs (16 of each you skip the analog sticks), plus the buttons for record/playback/loop mode. And, at this point, the sketch required would be way beyond the scope of my skills.
rboyd:
Does a CG controller obviate the need for the optocouplers and let us use transistors? For analog inputs as well? You mentioned having some difficulty in raising the resistance for the analog inputs without messing with the existing potentiometers, but I didn't quite understand.
You could probably avoid the optocouplers with the CG setup, assuming that you really do have a common ground with both the controller and the Arduino. So, as long as you don't have the controller plugged into the console and the Arduino plugged into a transformer/wall socket you should be fine. If you are powering the Arduino from the controller (i.e. tapping into the 5v & ground from the USB), or if the Arduino is powered via battery you should be fine. But, you may want to double-check with someone more technically inclined than myself. I ended up frying a controller while 'experimenting', so I could be wrong.
Keep in mind that transistors will only save you 1 solder point per button (and there are 24 "buttons"). And, using optocouplers makes sure that the Arduino and the controller are electrically isolated from each other. So, if you should mess something up while wiring your Arduino you won't risk toasting your controller.
Lurch:
Who copied who?
Similar, but not really a copy. In my case, once programmed, the 'Arduino-controller' sits there for hours on end grinding away at a specifically repetitive task. Basically, it replaces me having to be there at all. In his case, it is 'enhancing' the users's experience/ability while playing. One of the key elements that is missing (although it could probably be added) is the ability for the script to 'wait' extended periods of time (i.e. waiting for load screens, movie clips, etc).
And, if you just wanted to do short sequences, you can use the Viking 360 Macro Controller.
Neither of those solutions would work for what I wanted to do. For example, to get the 25,000 perfect reloads in Gears of War 3 (required for the Seriously 3.0 achievement) my script did the following:
A) start the game (A button)
B) wait for game to load
C) fire 1 round (right trigger)
D) perfect reload (right bumper, wait 0.7 sec, right bumper, wait 0.5 sec)
E) repeat steps C & D for 90 seconds from step A
F) wait for the game to end (30 seconds from step A, but added a small buffer)
G) complete the game, and restart from step A
Note that due to ammo limitations step E would run out of ammo shortly before 90 seconds was up, so it isn't possible to get the 25,000 perfect reloads in a row. But one could set the the games to 2 minutes long prior to starting the script and then let the script run the hundred or so games that were needed.
Another example is racking up credits or affiliation in Forza 4:
A) select race track (A button)
B) wait 38 seconds for the map to load
C) select 'Hire driver' (d-pad down 4 times, A, A)
D) wait 12 seconds for the load
E) select 'Start Race' (d-pad up 4 times, A)
F) wait for the end of the race (depending on the track 2 to 12 minutes)
G) select 'Continue' twice (A, A)
H) select 'Continue' a couple more times just in case something leveled up (A, A, A...)
I) wait 18 seconds for menu to load
J) restart from step A
Although both the BenHeck and Viking controllers allow for 'macros', neither covers the scope that I was looking for.
winner10920:
Instead of going and switchin every button why not tap into the matric pins themself and hi-lo the approriate channel? So instead of like 15 wires, just 8 or watever the matrix is wired as
I thought that, too. But after taking some multi-meter measurements at the various points, I quickly realized that I didn't have the skills to figure it out. Someone with an electronics background could probably whip up a solution for that. Course, going with a common ground (CG) controller has the same outcome -- reducing the number of wires needed significantly. Although not nearly as few as the main matrix points.