You can solve the problem with a 16 channels mux (74hc4067)
You connect one input pin of your pic to pin 1 of the mux.
Ground pin 12 and pin 15 of mux (Enable)
Connect pin 24 to + 5V
Connect Pins 10; 11; 13 and 14 to 4 output pins of your pic.
Pullup all 16 mux inputs with a 10k resistor
Ground all 16 mux input with n.o. switches
Write a code to scan the mux. Read input pin. If pin=0 then switch is close.
If pin=1 then switch is open.
Scan position will tell you wich swicth has been activated.
Al.
Bookmarks