Show Posts
Pages: 1 [2]
16  Using Arduino / General Electronics / Control an Xbox 360 controller analog stick on: January 05, 2012, 05:45:30 pm
I have the Uno and I'm trying to wire the buttons and joysticks of an Xbox 360 controller to it so that I can use the Arduino to control the controller (which will be wirelessly connected to the Xbox). I've figured out how to get the buttons to work, that was simple enough (IO pin to a resistor to the base lead of a 2N3906 transistor, positive button pad to the collector, negative button pad to the emitter, pull the pin low to "push" the button), but I'm having a hard time getting the analog sticks to work. The sticks are just pots used as voltage dividers. Looking at the front of the controller, the left pin is positive, middle is the wiper, and right is ground. The voltage at the wiper is how the Xbox decides how far to the left or right the stick is pushed. I tested the leads with a multimeter and found that there is 1.5V going across the pot, but since it's just a voltage divider, voltage doesn't really matter at all. I soldered a wire to the middle lead (without removing the pot itself) and connected it to a PWM pin and wrote a value of 127 to it, so it should have read as perfectly centered, but it just completely ignored it. I talked to a buddy of mine and he told me to put a cap between the wiper and ground leads, so I found a 10 nanofarad ceramic disk cap in my parts bin and soldered it in (still leaving the pot in place) then tried again. This time it took the input, but it was really erratic, and it affected the other analog controls (the other axis on the same stick, both axis' on the other stick, and both triggers) in a very sporadic way. I haven't tried it again since I made one last change, but I decided to power the controller using the Arduino by connecting the controller's VCC line to 3.3V and GND on the controller to GND on the arduino. It powers on just fine, the button pressing works fine, but I haven't tried to see if that changed anything with the analog control.

Having read this, is there anything that anyone here can help with. Am I doing things right, or is there a different way I should be going about it? Should I remove the pot completely, or add a resistor in series between the PWM pin and the wiper? Any help or information I can get will be extremely useful. I know quite a bit about electronics, but some things just confuse me, not sure why this is, but it is.

Anywho, thanks in advance!
Pages: 1 [2]