faster loop in "show"

pull/6/head
Greg Smith 2022-06-05 19:50:08 -04:00
rodzic 7bc29398d2
commit 3e817f90c4
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -236,8 +236,9 @@ class Neopixel:
cut = 8
if self.W_in_mode:
cut = 0
for i in range(self.num_leds):
self.sm.put(self.pixels[i], cut)
sm_put = self.sm.put
for pixval in self.pixels:
sm_put(pixval, cut)
time.sleep(self.delay)
# Set all pixels to given rgb values