触摸按键

在掌控板正面金手指处拓展6个触摸按键,依次P、Y、T、H、O、N。

触摸按键回调函数用法
from mpython import *

def on_touchpad_p_pressed(_):
    print('p')

touchpad_p.event_pressed = on_touchpad_p_pressed

def on_touchpad_y_pressed(_):
    print('y')

touchpad_y.event_pressed = on_touchpad_y_pressed

def on_touchpad_t_pressed(_):
    print('t')

touchpad_t.event_pressed = on_touchpad_t_pressed

def on_touchpad_h_pressed(_):
    print('h')

touchpad_h.event_pressed = on_touchpad_h_pressed

def on_touchpad_n_pressed(_):
    print('n')

touchpad_n.event_pressed = on_touchpad_n_pressed

def on_touchpad_o_pressed(_):
    print('o')

touchpad_o.event_pressed = on_touchpad_o_pressed

备注

掌控板板载6个触摸按键,依次从左到右分别touchPad_P、touchPad_Y、touchPad_T、touchPad_H、touchPad_O、touchPad_N,其他触摸按键使用方法同上。