Maker Pro
Maker Pro

Binary analog stick input?

Xephlon

Aug 1, 2018
6
Joined
Aug 1, 2018
Messages
6
First of all I apologise if I'm posting in the wrong category.

I'm working on a project where I use switches to change the values of an xBox analog stick. So one switch would turn on x, another y, -x and -y. I'm not 100% sure how to do this so if I could get some outside inspiration that would be great. Thanks :D
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
The analog stick will have some form of resistance (value) for the extremes of the axes which will have to be replicated at the switches of your 'digital' joystick.

i.e. the values of x and y need to be measured for the relevant stick positions and the mechanical switch you use has to 'put' those resistances into circuit when they are operated.

But since the resistances are usually only used to generate a voltage, you might find that the extremes of (analog) joystick movement are represented by simple +5V and 0V values - in which case just wire the switches to the relevant supplies.
 

Xephlon

Aug 1, 2018
6
Joined
Aug 1, 2018
Messages
6
The analog stick will have some form of resistance (value) for the extremes of the axes which will have to be replicated at the switches of your 'digital' joystick.

i.e. the values of x and y need to be measured for the relevant stick positions and the mechanical switch you use has to 'put' those resistances into circuit when they are operated.

But since the resistances are usually only used to generate a voltage, you might find that the extremes of (analog) joystick movement are represented by simple +5V and 0V values - in which case just wire the switches to the relevant supplies.

Thanks for that. So I need to replicate the power flow of each analog stick position by emulating the same amount of resistance?
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
So I need to replicate the power flow of each analog stick position by emulating the same amount of resistance?
Not specifically resistance. It may be easier with resistors IF the actual X-Y position voltages are 'weird' i.e. 4.3V and 3.7V (two random figures chosen as an example) but they may equally be 0V and 5V which can be derived quite readily from most logic interfaces.
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
Yes, but you really need to discover what the actual voltages are at the extremes of each axis movement of the analog controller to be sure.
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
The axis go from -x (bottom?) to 0 (joystick middle position) to + (top?).

If the span is set by the logic supply voltage (i.e. 5V) the -x will be 0V midpoint will be 2.5V and +x will be 5V.

So..... -x will be 0V (ground) and +x will be +5V. There is no way to simulate any intermediate position without having a varying voltage but since you aren't calling for anything other than the extremes then 0V and +5V would be the answer (IF 0V and 5V represent the extremes - measure them and find out!)

Each axis has its own voltage span - they are usually both 0V to 5V. It's only the way the wiring is done that differentiates between the two i.e. the X axis goes to one input, the Y axis to another.
 

Xephlon

Aug 1, 2018
6
Joined
Aug 1, 2018
Messages
6
midpoint will be 2.5V
Thanks so much for the help. One last thing though; would I need to run power through the circuit to emulate the 2.5v (or equivalent) that is the midpoint so the axis is centred?
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
If you want to have a 'centred' signal then yes, you will need the mid-point voltage from some source - have you established what the actual voltage span is yet?
 
Top