I want to have the option of using either thumb stick or joystick. Either with a toggle to switch between the two inputs or ideally using either one at whim without toggle. The latter being much more complicated I think.
Do yourself a favor. Don't waste your time trying to design an autoswitching circuit.
What you need is a DPDT (Double Pole, Double Throw) switch -- rocker or toggle.
Leave the 5v and ground (outer pins) on all four pots all of the time.
- This will draw twice as much current as a single stick, assuming the pots are the same resistance. The analog encoder should be able to handle that, no problem.
- If you wanted to switch X, Y, 5v and ground, you'd need a 4PDT switch.
The part to connect to the DPDT switch is the wiper (center pin) of each pot.
Scott
EDIT: Don't forget to make sure you have the analog joystick oriented the same way as the thumbstick.
- You need to check both the X-axis and the Y-axis.
- If left on the thumbstick causes the X voltage to decrease, left on the larger stick should do the same.
- If down on the thumbstick causes the X voltage to decrease, down on the larger stick should do the same.
- If you've got the larger stick turned 90 degrees and you swapped the X- and Y-axis wires, one of the axes will move the opposite direction of the thumbstick. i.e. Up/down might be the same on both, but left/right is backward on one.