Python neopixel package bugs All In One

发布时间 2023-05-07 21:33:25作者: xgqfrms

Python neopixel package bugs All In One

Python 3

Python neopixel library docs


https://docs.circuitpython.org/projects/neopixel/en/latest/index.html

https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel

bugs ❌

https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/issues/151

https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/issues/142

demos

$ sudo pip3 install rpi_ws281x

$ sudo pip3 install adafruit-circuitpython-neopixel

$ sudo pip3 install --force-reinstall adafruit-blinka
# equal to
$ sudo python3 -m pip install --force-reinstall adafruit-blinka

image

Raspberry Pi 3B, BCM GPIO 18 PIN

Python 3.9.2

one WS2812B RGB LED strip of 1M long with 60 LEDs

#!/usr/bin/env python3
# coding: utf8

import board
import neopixel
from time import sleep

# 60 LEDs
pixels = neopixel.NeoPixel(board.D18, 60)
while True:
  for x in range(0, 60):
    pixels[x] = (255, 0, 0)
    sleep(0.1)

"""
$ chmod +x ./led-strip.py
# ❌ Can't open /dev/mem: Permission denied
# $ ./led-strip.py

# ✅
$ sudo ./led-strip.py
"""

(? 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

https://www.cnblogs.com/xgqfrms/p/17379126.html#5174685



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 ?️,侵权必究⚠️!