Closed
Description
I've tried to implement the SPI-Version of the NeoPixel library.
My project uses audio (Raspberry Zero W with a Hifiberry Mini Amp), and I'm running out of alternatives for using color LEDs. (or am I missing something?)
But not all my color assignments to the pixels are showing.
So I've modified the blink program to test it thoroughly:
# This example shows how to create a single pixel with a specific color channel
# order and blink it.
# Most NeoPixels = neopixel.GRB or neopixel.GRBW
# The 8mm Diffused NeoPixel (PID 1734) = neopixel.RGB
import time
import board
import neopixel
# Configure the setup
COLOR = [ # color to blink
(127, 0, 0),
(63, 63, 0),
(0, 127, 0),
(0, 63, 63),
(0, 0, 127),
(63, 0, 63)
]
CLEAR = (0, 0, 0) # clear (or second color)
DELAY = 0.25 # blink rate in seconds
# Create the NeoPixel object
pixel = neopixel.NeoPixel_SPI(board.SPI(), 2, pixel_order=neopixel.RGB)
# Loop forever and blink the color
n = 0
while True:
if n>5: n=0
pixel.fill(COLOR[n])
n=n+1
time.sleep(DELAY)
pixel.fill(CLEAR)
time.sleep(DELAY)`
When running this program, the first iterations are missing, and after a few loops there appear gaps in the blink sequence.
Is this due to some fault in the code or did I miss setting anything on my system? (SPI is enabled of course, and my Neopixel is attached to D10)
(I've installed the library with PIP on nov 30 2019)
Metadata
Metadata
Assignees
Labels
No labels