Normally one tact switch requires one digital input pin of a microcontroller. Some designs implement keypad style multiplexing to get multiple switches on fewer inputs. However, there exist other techniques that allow you to connect many switches on a single input pin of a microcontroller. This tutorial demonstrates one such technique as applied to PIC12F683 microcontroller. In this example, there are four LEDs and four tact switches connected to the PIC12F683 microcontroller. While each LED is controlled through an individual I/O pin, the four switches are connected to one ADC input pin of the PIC12F683 microcontroller.
Connecting multiple tact switches to one input pin of PIC micro