Monitor 15 contacts with one PIC input
Several previously published Design Ideas and appnotes [1-4] show how to use many pushbuttons with a minimum number of inputs. They require an RC circuit where the timing can be measured to identify which pushbutton has been pressed, or an ADC input, with resistors forming a divider for each pushbutton pressed.
The following Design Idea shows another simple way to use up to 15 pushbuttons with only one I/O. The microcontroller chosen must contain an internal comparator with selectable values for the internal voltage reference VREF. The majority of 8-bit PIC microcontrollers in the mid-range family feature one or two internal comparators with just this.
For more detail: Monitor 15 contacts with one PIC input
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw