Working with the TPS2L Keypad

tpp2_keypad

The TPP2 board can be supplied as a part of the size 2 Tibbo Project System with LCD/keys (TPS2L, see Programmable Hardware Manual). This device features a 4-key sensor keypad.

Use the code below to setup the kp. object for working with the keypad of the TPS2L and reset the keypad:

** Tibbo Basic **

'Reset the touch controller of the keypad
io.num=PL_IO_NUM_44
io.enabled=YES
io.state=LOW
io.state=HIGH

'Setup the kp. object
kp.returnlinesmapping="36,37,38,39" 'no return lines
kp.enabled=YES

The key_code argument of the on_kp event will return the following key codes:

  • Code 0 for the leftmost key
  • Code 1 for the second key (counting from the left)
  • Code 2 for the third key (counting from the left)
  • Code 3 for the rightmost key