You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, great project !
I noticed the Rainbow Chase array would almost instantly freeze on my 70 LED strip on an RPI Pico W.
The error in the console is :
Traceback (most recent call last):
File "uPixels.py", line 90, in execute
File "uPixels.py", line 249, in rainbowChase
File "neopixel.py", line 1, in __setitem__
IndexError: bytearray index out of range
Turns out on line 249 and 253 of uPixels.py, the self.np[i + q] instruction indexes the array out of bounds because :
for i in range(0, self.np.n , 3) will generate 69 as the max value
for q in range(3) will generate 0, 1 and 2
therefore self.np[i + q] can reach 70, 71, both out of bounds
The best solution I found was to add -2 to lines 247 and 252, like so :
for i in range(0, self.np.n - 2, 3):
And then everything works !
The text was updated successfully, but these errors were encountered:
Hello,
First of all, great project !
I noticed the Rainbow Chase array would almost instantly freeze on my 70 LED strip on an RPI Pico W.
The error in the console is :
Turns out on line 249 and 253 of
uPixels.py
, theself.np[i + q]
instruction indexes the array out of bounds because :for i in range(0, self.np.n , 3)
will generate 69 as the max valuefor q in range(3)
will generate 0, 1 and 2self.np[i + q]
can reach 70, 71, both out of boundsThe best solution I found was to add
-2
to lines 247 and 252, like so :for i in range(0, self.np.n - 2, 3):
And then everything works !
The text was updated successfully, but these errors were encountered: