GPIO.py 文件源码

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

项目:raspberry-gpio-emulator 作者: nosix 项目源码 文件源码
def output(channel, outmode):
    # type: (int or Sequence[int], int or bool or Sequence[int] or Sequence[bool]) -> None
    __check_mode()

    if isinstance(channel, Sequence):
        def zip_outmode():
            # type: () -> Sequence[tuple]
            if isinstance(outmode, Sequence):
                assert len(channel) == len(outmode)
                return zip(channel, outmode)
            else:
                return zip(channel, [outmode] * len(channel))

        for (c, m) in zip_outmode():
            __output(__to_channel(c), m)
    else:
        __output(__to_channel(channel), outmode)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号