Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Neopixel 8x8 run with pi not responding past LED 30
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Neopixel 8x8 run with pi not responding past LED 30

by airborn4x4 on Mon Sep 07, 2020 8:11 pm

I am running a Neopixel 8x8 with a Raspberry Pi B+, and just testing it out. I have a simple x+=1 to increment the pixel number. Everything works fine up to pixel 30, then I get the following error.

Traceback (most recent call last):
File "/home/pi/NeoPixelTest.py", line 9, in <module>
pixels[x] = (255, 0, 0)
File "/usr/local/lib/python3.7/dist-packages/adafruit_pypixelbuf.py", line 314, in __setitem__
self._set_item(index, r, g, b, w)
File "/usr/local/lib/python3.7/dist-packages/adafruit_pypixelbuf.py", line 280, in _set_item
raise IndexError
IndexError

airborn4x4
 
Posts: 11
Joined: Wed Apr 11, 2018 8:22 pm

Re: Neopixel 8x8 run with pi not responding past LED 30

by caitlinsdad on Mon Sep 07, 2020 9:07 pm

Make certain if you have an RGBW neopixel matrix or the RGB kind.
The config needs to be defined for the the type you are using, if RGBW, the pixels[x] = (255, 0, 0, 0) needs a fourth parameter for the W white color value.

See the guide for more info https://learn.adafruit.com/neopixels-on ... thon-usage
Good luck!

caitlinsdad
 
Posts: 611
Joined: Fri Feb 24, 2012 4:23 pm

Re: Neopixel 8x8 run with pi not responding past LED 30

by airborn4x4 on Tue Sep 08, 2020 12:28 pm

Ah ha! I figured out my problem. I need to read better. When initializing the neopixel with pixels = neopixel.NeoPixel(board.D18, 30) I need to change the 30 that was given on the code on your website, to the number of pixels on my 8x8, 64. Instructions were there, I just needed to RTFM.

Thanks

airborn4x4
 
Posts: 11
Joined: Wed Apr 11, 2018 8:22 pm

Please be positive and constructive with your questions and comments.