XBOX 360 Controller Hack (add macro ability)

Updates on the project...


First of all, I figured out how to get the analog sticks to work. Short the wiper pin to 'low' for full one way, and short it to 'high' for full the other way. Keep in mind that the controller does not use the full motion of the pot, so I inserted a small (220 ohm) resistor (in addition to the resistance of the optocoupler). For anyone doing this with transistors, I measured about 480 ohm at the lowest/highest points when in the enclosure by connecting the controller to a PC and using the raw calibration data from the Properties dialog. You could probably short it (I know I did once or twice while tinkering and the controller survived) but adding a small resistor (330 to 470 ohm) would make it appear more like the original pot was creating the motion. The 'low' is the ground for analog sticks on both matrix and CG controllers. The 'high' is common to ALL of the analog sticks (i.e. common high?) but is not the same as the 5v or 3.3v elsewhere on the board. So I ended up needing 1 wire for ground (already had it for the other CG buttons anyway), 1 wire for high (from one of the pot high pins), and 4 wires for the sticks (2 wipers per stick). However, you will need 8 optocouplers (or transistors?) - one to pull high and one to pull low for each wiper wire. It may be possible to use transistors to trigger the sticks since they use common ground, but I used optocouplers (since I already had them anyway).

Although I have my analog sticks wired to the PWM capable pins on the Arduino (via the optocouplers), I haven't gotten around to testing PWM yet. But, I have a hunch I will be able to generate something close to analog movement on those sticks. When I have some time I will hook up a pot to one of the Arduino analog in pins and see if I can generate the corresponding analog responses on the controller. I probably won't get around to this until I encounter an actual need for anything other than full displacements.

I also added a buzzer (so that the Arduino-controller could get my attention when a step needed my intervention), as well as a display for feedback (had some debugging issues with one of the scripts, and knowing where in the script the Arduino thought it was would have come in handy). No specific reason for the 2 digit display, other than I happened to have it laying around. The two shift registers were used to reduce the number of pins needed to drive the display.

Also, since I have a couple pins free on the controller side, I will probably end up moving the 'trigger buttons' into the controller a little below the A button (using through-hole tact switches).

In theory, I would call this a 'debug shield', and a smaller production board could be created without the display/shift registers and trigger buttons. With a little tinkering, I think I could fit the smaller "non-debug" shield entirely within the size of the battery compartment. And, if I switch over to a smaller Arduino (nano/mini?), there would be nothing sticking out. Course, with only 14 outputs, I would have to either figure out how to get 3 states out of a single pin (for the analog sticks) or skip 2 of the buttons (probably the 'click' of the analog sticks).

Now to find a case/enclosure to wrap it all up nice and neat... :wink: