创客百科

姿势共享,有节操无门槛参与的创客百科,创客动力之源 \ (^_^) /

用户工具

站点工具


saks:sdk:libraries:tactrow

这是本文档旧的修订版!


A PCRE internal error occured. This might be caused by a faulty plugin

====== TactRow ====== 轻触开关组类,读取单个轻触开关的状态。 ===== 方法 ===== ==== __init__(self, pin, real_true = GPIO.HIGH) ==== 初始化对象,设置引脚和触发电平(高电平或低电平触发)。pins 为 IO 引脚数组。 ==== is_on(self, index) ==== 返回当前轻触开关的按下状态。true 或 false。index 为 LED 编号,从 0 开始。 ==== row_status(self) ==== 返回当前轻触开关组的工作状态的数组。 ==== items(self) ==== 返回当前轻触开关组的对象数组。 调用方法: <code> tact_event_handler = None def on_tact_event(self, pin, status): #print('on_tact_event') if self.tact_event_handler is not None: self.tact_event_handler(pin, status) def tact_event_handler(pin, status): ''' called while the status of tacts changed :param pin: pin number which stauts of tact is changed :param status: current status :return: void ''' print('tact_event_handler') print("%d - %s" % (pin, status)) SAKS.tact_event_handler = tact_event_handler </code>

本页面的其他翻译:
saks/sdk/libraries/tactrow.1485153111.txt.gz · 最后更改: 2017/01/23 14:31 (外部编辑)