Hey guys, so, i've recently started a new arduino project, where my goal is to create a controller for a flight simulator.
I decided to start by trying to recreate the x-plane's cirrus SF-50 vision switch pannel, that consists of 15 toggle switches and a potentiometer.
I've done a lot of research on the topic, figured out how to code it, but i am struggling with the hardware. firstly i bought a toggle switch with 2 terminals, so when i hooked it up to xplane 11 i could only turn things on, but when i turned it off it didn't do anything (figured out why a little bit later), now i realized i need toggle switches with 3 terminals to turn things on and off.
My problem right now is that i would need 26 pins to properly wire this, and the arduino pro micro that i want to use for this project only has 17. I thought about doing a matrix like people do for push buttons, but since all the switches have to be toggled ON simultaneously, i dont think that it would work. Does anyone know a solution for this problem?
Im also sending the images of both the pannel and the matrix that i think will not work (but is the only thing i thought so far)
NOTE: on the image from the sim there are 15 switches but 2 of those are not "assignable", that's why im only trying to connect 13.
Yes, with the matrix i would only need 7, but what i thought is that, for example, if i toggle the A1 switch, then the B1, then the A2, when i go and toggle the B2 switch it wouldn't be recognized because its line and column are alredy sending "signal" to the arduino, and i need all 13 of them to be ON simultaneously, so i thought that this matrix would not work. but, are you saying it does?
Also, excuse me for any begginer mistake, i am quite new to this. And thank you so much for the replies
jlancha:
Yes, with the matrix i would only need 7, but what i thought is that, for example, if i toggle the A1 switch, then the B1, then the A2, when i go and toggle the B2 switch it wouldn't be recognized because its line and column are alredy sending "signal" to the arduino
That is a common problem with matrices that can be solved by adding diodes.
Of course a matrix has to (and can) deal with multiple switches on at the same time!
In your case, if it is just on/on without an off, you can just approach every button as if it were a regular on/off switch. No difference here, really. That makes for 8 pins total in a matrix configuration (4x4 matrix, allowing for up to 16 switches).