Wrangling 21 buttons and 9 sliders for a game controller (CircuitPython, Feather)

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
owntheweb
 
Posts: 83
Joined: Fri Oct 24, 2014 4:03 pm

Wrangling 21 buttons and 9 sliders for a game controller (CircuitPython, Feather)

Post by owntheweb »

Hello gurus,
I’m building a game controller. In attempting to wrangle the “basics” for a favorite flight game, I ended up with a lot of buttons… (21, plus 9 sliding values). Simple! ;)

I’m still drawing this out, yet think I can chain most the buttons into a Feather or two via Qwicc adapters and work out the analogue inputs with pins and making use of CircuitPython. (full details on that plan upon request)

Thank you for posting multiple wonderful examples! I’m absorbing these now.

Question: HID device(s) seem preferred, yet is that possible with all the button and analogue outputs? Example projects I see make heavy use of MIDI. Would that be a better route? Is there a preference to use something other than a Feather for wrangling input/output? (starting with Feather because it’s super cool)

Thanks for the brain check and extra ideas in advance!

User avatar
owntheweb
 
Posts: 83
Joined: Fri Oct 24, 2014 4:03 pm

Re: Wrangling 21 buttons and 9 sliders for a game controller (CircuitPython, Feather)

Post by owntheweb »

hosas-top.png
hosas-top.png (4.41 KiB) Viewed 83 times
More context: Here's my current draft of the top layer of my HOSAS. It includes two small three-axis joysticks with single buttons on top, along with three additional NeoSliders. It includes a couple rows of NeoKeys. I'm really digging these RGB momentary buttons with that, and this latching one for the center.

I couldn't get one of these to fit. Maybe next time. ;)

User avatar
johnpark
 
Posts: 985
Joined: Wed Mar 25, 2009 2:15 pm

Re: Wrangling 21 buttons and 9 sliders for a game controller (CircuitPython, Feather)

Post by johnpark »

Very cool! The main constraints you'll run into is the available analog inputs on most microcontrollers to read nine slide pots and 21 digital inputs for the buttons. Three approaches I'd consider:
Grand Central https://www.adafruit.com/product/4064 which has 16 analog in pins and something like 50 digital pins still available after that.

Another approach is to use your Feather (RP2040 is a great choice) or other microcontroller plus I2C seesaw breakouts such as the NeoSliders and LED Arcade Button 1x4 as I did in these two projects https://learn.adafruit.com/neocontrolle ... -input-box and https://learn.adafruit.com/arcade-synth-controller.

Finally, you can use an ADC chip https://www.adafruit.com/product/856 or breakout https://www.adafruit.com/product/4648 to add more analog ins, and a digital IO expander such as https://www.adafruit.com/product/5545 for any extra buttons that aren't covered by your Feather.

User avatar
owntheweb
 
Posts: 83
Joined: Fri Oct 24, 2014 4:03 pm

Re: Wrangling 21 buttons and 9 sliders for a game controller (CircuitPython, Feather)

Post by owntheweb »

Thanks @jonpark!

Those projects are super cool and I've been referencing the keyboard/slider one for this (thank you for posting!!). With that, I like the idea of sending low latency MIDI data and having a virtual joystick manage things on the PC, perhaps midi2vjoy. I went with the pink RP2040 and have hooked in a set of mechanical keys so far to experiment with. A friend 3D printed the piece that came from your tutorial as well, super helpful!

The single red-ringed 16mm button I ordered to test out turned out to be too small (my brain still struggles with mm sometimes, like a pinky button). I may try one of the larger RGB ones as they are neat, yet I may need to mix it up as my wallet may not like 11 22mm RGB ringed buttons hah (may need the Grand Central device as well at that point).

Thanks a ton for the great feedback.

User avatar
dairequinlan
 
Posts: 3
Joined: Mon Oct 24, 2022 4:35 am

Re: Wrangling 21 buttons and 9 sliders for a game controller (CircuitPython, Feather)

Post by dairequinlan »

You could potentially handle all the buttons with only 10 pins if you wire them up using a matrix as with most full keyboard implementations, i.e. 5x5 or 7x3 or something similar. The sliders, that's another story :-)

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”