keypad (multiplexed input) functions are provided in the libraries
LIB/keypad_lib.bas
keypad_init
Initialises the keypad subsystem
read_switch
Read the current state of a keypad switch
debounce_keypad_queue_service
Service the keypad subsystem