xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> Controlling A Controller With An Arduino
HaLo2FrEeEk
post Jan 4 2012, 10:32 AM
Post #1


X-S Young Member
*

Group: Members
Posts: 50
Joined: 26-February 09
Member No.: 406114



I'm trying to make a simple circuit that will allow me to use my computer and an Arduino to control my controller. Mainly I just want to be able to control the right analog stick, both directions. I know that the potentiometer is a simple voltage divider, but I'm having trouble getting things to work. I've currently got wires running from the three pot leads for the left/right rotation, but I don't know what to do with them. I tried connecting the outer two leads to two digital output pins and using a program I wrote to send signals to the Arduino through Serial connection, I have a button for left and a button for right, but it doesn't work. For some reason when I press the right button nothing happens but when I press the left button the controller restarts, I'm not sure what's happening, but I'd really like some help.

I wouldn't mind being able to press some of the buttons either, but I know how to do that with a resistor and a transistor, so I just need to work out how to do the rotation.

Thanks in advance to anyone that helps, I just got my Arduino today and I'm having a lot of fun with it, I'm just stumped here.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dougiegillam
post Jan 4 2012, 01:32 PM
Post #2


X-S Senior Member
**

Group: Members
Posts: 208
Joined: 10-November 06
From: North Wales.UK
Member No.: 310428
Xbox Version: unk
360 version: v5.0 (360S - trinity)



QUOTE(HaLo2FrEeEk @ Jan 4 2012, 11:32 AM) *

I'm trying to make a simple circuit that will allow me to use my computer and an Arduino to control my controller. Mainly I just want to be able to control the right analog stick, both directions. I know that the potentiometer is a simple voltage divider, but I'm having trouble getting things to work. I've currently got wires running from the three pot leads for the left/right rotation, but I don't know what to do with them. I tried connecting the outer two leads to two digital output pins and using a program I wrote to send signals to the Arduino through Serial connection, I have a button for left and a button for right, but it doesn't work. For some reason when I press the right button nothing happens but when I press the left button the controller restarts, I'm not sure what's happening, but I'd really like some help.

I wouldn't mind being able to press some of the buttons either, but I know how to do that with a resistor and a transistor, so I just need to work out how to do the rotation.

Thanks in advance to anyone that helps, I just got my Arduino today and I'm having a lot of fun with it, I'm just stumped here.

Try here.
http://www.built-to-spec.com/blog/2009/09/...th-the-arduino/
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
HaLo2FrEeEk
post Jan 4 2012, 04:43 PM
Post #3


X-S Young Member
*

Group: Members
Posts: 50
Joined: 26-February 09
Member No.: 406114



QUOTE(dougiegillam @ Jan 4 2012, 04:32 AM) *


Ok, read the whole thing, still not understanding why it's not working. The Xbox 360 controller joysticks are already voltage dividers, with 1.5V going through. When it's in the middle, either of the outside leads and the middle lead will always read .75V, pushing it to one side brings that side higher and the other side lower. I tried connecting a pulse-width modulated digital IO pin to the middle (wiper) lead and adjusting it, but the controller would either turn off or just completely ignore the input. Still whenever I put ANY voltage through the left lead the controller shuts off and restarts, but it just ignores voltage through the right lead (maybe because the right lead is GND and the left lead is V+?) At any rate, it's starting to get me really frustrated and I'd really like to figure it out, so any more help will be greatly appreciated.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
limpgoat
post Jan 4 2012, 06:38 PM
Post #4


X-S Enthusiast


Group: Members
Posts: 4
Joined: 15-November 08
Member No.: 395758



QUOTE(HaLo2FrEeEk @ Jan 4 2012, 10:43 AM) *

I tried connecting a pulse-width modulated digital IO pin to the middle (wiper) lead and adjusting it, but the controller would either turn off or just completely ignore the input.



You'll have to smooth out the pwm signal. First enable fast PWM if you haven't already, and use a low-pass filter between the pwm pin and the wiper. Full deflection on the analog stick is, I believe, only 1.8v, so you'll either want to divide down the 5v signal as well or just keep the duty cycle at roughly 35% or less.

Good luck bud
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
HaLo2FrEeEk
post Jan 5 2012, 03:08 AM
Post #5


X-S Young Member
*

Group: Members
Posts: 50
Joined: 26-February 09
Member No.: 406114



So I am just connecting the PWM pin to the wiper and none of the other pins on the pot, right? I did a quick test with the multimeter and determined that the pot uses no more than 1.5V, so I adjusted my sketch to map the 0-255 down to 0-80 (an analogWrite value of 80 will give me 1.5V), connected the wiper to a PWM pin, but when I change the value, it doesn't do anything at all.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
HaLo2FrEeEk
post Jan 5 2012, 10:46 AM
Post #6


X-S Young Member
*

Group: Members
Posts: 50
Joined: 26-February 09
Member No.: 406114



Sorry for the double post.

Ok, I talked to a buddy of mine who knows a thing or two and he told me I should put a capacitor in parallel between the wiper and ground of the variable resistor. I found a 10 nanofarad ceramic disk cap and soldered it in (from what I learned, when looking at the back of the controller, the right pin is V+, the middle pin is, obviously, the wiper, and the left pin is GND, so I put the cap between the wiper and the left pin). I wrote a simple Arduino sketch that will pulse a pin between 20 and 60 (which equals out to .35V and 1V, 40 would be .75V, or dead center) and at the same time turn an LED on and off (so I can know when it's switches, light on means it's telling the controller to look left, light off means right). I've got the controller plugged into my computer with the Wireless Receiver and I'm monitoring it in the Game Controller Properties. When it switches, I do see a change in the bars, but it's really erratic, not a smooth change from one side to the other.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 25th May 2013 - 10:09 AM