apa102.py 文件源码

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

项目:rainbow-hat 作者: pimoroni 项目源码 文件源码
def show():
    """Output the buffer"""
    global _gpio_setup

    if not _gpio_setup:
        GPIO.setmode(GPIO.BCM)
        GPIO.setwarnings(False)
        GPIO.setup([DAT,CLK,CS],GPIO.OUT)
        _gpio_setup = True

    GPIO.output(CS, 0)
    _sof()

    for pixel in pixels:
        r, g, b, brightness = pixel
        _write_byte(0b11100000 | brightness)
        _write_byte(b)
        _write_byte(g)
        _write_byte(r)

    _eof()
    GPIO.output(CS, 1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号