Many (some simultaneous) buttons... again...

I know this has been answered a few different ways, but I’m curious about WHICH way to go with a project I’m toying with.

I have a couple of old legacy joysticks: a Thrustmaster FCS/WCS and FLCS/TQS combo that I’d like to interface with an Arduino via a USB hack (like my OrbShield).

There are a few buttons involved!

FCS (stick): 4 buttons, 1 4-way hat, 2 pots
WCS (throttle) : 6 buttons, 1 3-way rocker, 1 pot

That’s not SO bad, but the FLCS/TQS is worse:

FLCS: 5 buttons, 4 4-way hats, 2 axes, one two-way rocker
TQS: 1 mouse (may not even try), 3 pots, 1 4-way hat, 1 button, 1… 3-way rocker, 1 2-way slide?

Well, it’s a lot of inputs anyway, and should in theory be able to handle multiple presses… obviously the rockers and hats can’t have multiple positions at once, but either way it’s a bunch. I’d like a solution that

  • Can read multiple button presses
  • Has fast enough response time that it’s useful for gaming
  • Preferably uses few-ish wires, but that’s negotiable.

I’ve seen a few strategies recommended:

  1. For a few switches, using the analog lines with resistors is recommended. But that’s probably not great here since we want multiple presses. This technique WOULD work fine for the hat switches and rockers, but I’m not crazy about mixing methods.

  2. Port expanders like that shown in SpikenzieLabs’ Project64 page. That looks a bit matrixy, though, and doesn’t that mean multiple keypresses are a problem?

  3. Just use an Arduino Mega; that’s got a whole lot of input lines and it’s not all that expensive.

  4. Shift registers as in the ShiftIn example. I actually grabbed a few of these and went through the example and the basic idea looked good… but I’m a little concerned about response time, just because I don’t know enough about it… and that seems like quite a few pulldown resistors. And with 8 buttons per cascaded shift register, the FLCS/TQS would take three registers for the button/hat inputs; can you read those fast enough that they would feel “instant”?

I really don’t know enough about this, but what strategy would the experts recommend?

Did a bit more reading, and given that the SNES controller evidently used two 4021 shift registers (?), I'd say it's game-controller ready. I'm still not sure how sanguine I am about reading loads of switches with 3-4 cascaded 4021s, but it may simplify some things wiring-wise (particularly since in each case I have to connect a joystick to a throttle, or both to an interface board; would be simpler to have the buttons multiplexed into a few lines).

Is there any "better/more appropriate" shift register than the 4021, or any way to avoid one 10k resister per switch? That just winds up being an awful lot of resistors.

(or is there still a better way to do this?)

You need one resistor pr. switch to pull it up (or down).

One thing you need you take into consideretion very early in your design is switch debouncing. If this is done in software it could introduce unwabted delay, with that many switches and the wish to read them simoultaneously.