110118-0001A
29
4.3.6
Keypad Scan
The ADSmartIO can scan a matrix keypad up to four by five keys in size. Matrix keypads are
simpler and cost less than full keyboards and can be easily customized for your application. You
can also create a keypad matrix from a collection of normally-open switches.
When configured to scan a keypad, the ADSmartIO configures the ROWn lines as inputs with
software pull-ups enabled and configures the COLn lines as outputs set to "1"(high). For the scan,
the keypad scanner sets successive COLn outputs to "0"(low), then looks for a "0" on one of the
ROWn inputs. The scanner re-reads the pressed key after a delay to debounce the key press.
Unused column lines can be used for general purpose I/O or A/D. Unused row lines can be used
for general purpose I/O only.
The following diagram illustrates how to connect a 3x3 keypad matrix. The pull-ups are the
software-activated internal resistors of the ADSmartIO, while the series resistors are part of the
BitsyXb.
SW1
SW4
SW7
SW2
SW5
SW8
SW3
SW6
SW9
ROW 0
ROW 1
ROW 2
COL 0
COL 1
COL 2
ADSmartIO Controller
3 x 3 Keypad
BitsyXb