So I'm thinking about adapting a project to a PTH only which means moving from a 64 pin TQFP to a 40 pin DIP. I need 26 LED's and 31 momentary switches.
My thoughts are 8 columns (shared) and 4 rows for the LED and 4 rows for the switches so it could be done in 16 pins.
Is the best plan this:
All rows HiZ when inactive
To light up a LED row set it to output low, use output high on the columns which through a resistor to the LED anode.
To scan a switch row set it to output low, use input pullup enabled on the columns and then see if any are low.
Does it matter if the switch columns are connected to the uc or after the LED resistors?