i am running out of pins on the pro micro(clone) for my flight sim box. will a button matrix that is 4 rows and 3 columns work if the last column instead of 3 has a 4th button ? in the picture below the last fuel mix button(fuel mix 3
) is connected to the 3rd column since i dont have pins left to attach it
I'd be inclined to use an I2C I/O extenders,then you can add more extenders and controls more easily.
Admittedly, you'll lose A4 and A5.
Why do the fuel mix buttons have 3 wires?
If by 'work' you mean will your code be able to distinguish fuel mix 2 from fuel mix 3, well obviously not.
It is usual to put diodes in a switch matrix so that one operated switch doesn't short everything out making it impossible to detect any others at the same time.
I have added diodes now to the circuit. My fuel mix buttons are on-off-on,a perfect solution would be sp3t switches off-on-on but they seem to be very expensive or hard to find where i live. Thus using some code magic on(off fuel)-off(lean)-on(high mix) . Are the diodes now at their proper position ? i read some blogs and followed the instructions to add the diodes.
This page has the correct wiring for a diode-switch network:
https://electronics.stackexchange.com/questions/379799/matrix-of-spst-switches-and-buttons-with-arduino
What are you using the SPI pins for?
digital i/io since i was running out of pins and all pins are anyways digital so
i see thanks,so basically not in series but in parallel.
Ok, did not see the wiring in the diagram and was going to suggest using for the matrix.
No, see link from @MarkT
I still don't understand your fuel mix switch wiring, you don't need 3 wires. There is no way I can think of to distinguish fuel mix 2 from fuel mix 3.
You can use resistors and multiple buttons on the same analog input then detect which button pressed by measuring voltage, they all will be different proportional to resistors used
But you have to debounce by reading the voltage twice as if you catch it while changing the voltage is a time average and may end up being an entirely different option than meant.
you don't need 3 wires.
the spdt have three prongs at the bottom the common middle one i was sending to ground.will try the switch without it.
so slight change in the origininal plan,i wont be programming it.There is this software called mobiflight that supports potentiometers etc and maps everything directly to the ingame buttons.So there is no need to code. Just everything needs to be properly wired.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.