Slow performance setting Neopixels
whogben opened this issue · 1 comments
whogben commented
I am following the neopixel tutorial on a raspberry pi 4 and getting unexpectedly slow performance.
Setting 60 neopixels takes approximately 0.2 seconds using the following code. Is there a trick to making it faster?
import board
import neopixel
import time
import random
pixels = neopixel.NeoPixel(board.D21, 60)
pixct = 60
while (True):
t1 = time.time()
for i in range(1,pixct):
pixels[pixct - i] = pixels[(pixct - i)-1]
t2 = time.time()-t1
print(str(t2))
pixels[0] = [random.randint(0,255),random.randint(0,255),random.randint(0,255)]
I am hoping to play cool sequences at 30fps or faster across the entire 60 neopixel strip - looking for a smooth effect - but right now, 5fps is the maximum. Many thanks in advance for your ideas / suggestions.
whogben commented
OK i found a workaround by turning off autowrite - if autowrite is on it's slow, with autowrite off it's quick.