raspberrypinixie.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:raspberrypinixie 作者: sroaj 项目源码 文件源码
def _pin_pulse(pin, initial_state=GPIO.LOW, pulse_width=PULSE_WIDTH_SEC):
    # type: (int, bool, Union[int, float]) -> None
    """Sends one pulse to the specified pin.

    The pin will be returned to the specified initial state after the pulse

    Args:
        pin: The pin to pulse.
        initial_state: The negation of this will be used as the pulse.
            Defaults to GPIO.LOW.
        pulse_width: how long, in seconds, to pulse the pin.
            Defaults to PULSE_WIDTH_SEC.
    """
    GPIO.output(pin, not initial_state)
    try:
        time.sleep(pulse_width)
    finally:
        GPIO.output(pin, initial_state)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号