Grounds can be shared.
For connecting many switches you could connect them in a matrix with rows and columns (which is how a keyboard works). You set each column to output high in turn and see which (if any) of the rows goes high. Then you can detect which button is pressed. It gets a bit harder when more than one button is pressed at a time, but there are ways around that, maybe ignore input if more than one is pressed, or use diodes on each button so you can detect exactly which buttons are pressed.
For connecting many switches you could connect them in a matrix with rows and columns (which is how a keyboard works). You set each column to output high in turn and see which (if any) of the rows goes high. Then you can detect which button is pressed. It gets a bit harder when more than one button is pressed at a time, but there are ways around that, maybe ignore input if more than one is pressed, or use diodes on each button so you can detect exactly which buttons are pressed.
Statistics: Posted by rpdom — Thu May 02, 2024 10:53 am