Working With the TPB2L Keypad
Installing a TPP2 or TPP2(G2) and its attached Tibbits inside a TPB2L creates a Size 2 Tibbo Project System With LCD/Keys (TPS2L). This device features a four-key sensor keypad.
Use the code below to set up 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
'Set up 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 keycodes:
- Code 0 for the left-most 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 right-most key