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
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
"""