当前位置:首页 > windos > 正文

12、API - 输入设备(API - Input Devices)

官网地址:https://gpiozero.readthedocs.io/en/stable/api_input.html

环境:UbuntuMeta-16.04

树莓派:3代B型

提供这些简单地日常使用的输入设备组件接口。 在使用代码之前,必须正确使用该组件。

注意:所有GPIO引脚编号均使用Broadcom(BCM)编号。 有关详细信息,请参阅“基本配方(2、基本方法(Basic Recipes))”页面。

12.1. Button(按钮)

 classgpiozero.Button(pin, *, pull_up=True, bounce_time=None, hold_time=1, hold_repeat=False, pin_factory=None)[source]