pololu / pololu-led-strip-arduino

Arduino library for addressable RGB LED strips from Pololu
http://www.pololu.com/catalog/product/2540
MIT License
163 stars 85 forks source link

The colors array can't be over 87 pixels, hangs up the Arduino #8

Closed Passiday closed 9 years ago

Passiday commented 9 years ago

I obtained my WS2812B strip from another vendor but that should not matter, as the product is pretty much identical. I wanted to try out the LedStripRainbow example and discovered that it breaks at pixel counts above 86. Which at first seems like arbitrary number, but since the size of the colors array is 86*3=258, it goes beyond the size describable by one byte. It's just my guess, because I failed to pinpoint the bug. I eventually switched to Adafruit NeoPixel library that does not have this problem.

hansaya commented 9 years ago

Just you know most arduino's not capable of running huge amount of leds. It will drop the frames by quite a bit. Arduino takes bit of time to send the byte and have to send all that data serialy not parallely.

Passiday commented 9 years ago

Well, you are completely right, I managed to stall my Mega (using Adafruit library) just by turning up the intensity of the pattern. Ok, I admit I was reckless just by going on and driving all the 150 pixel strip by the on-board power, but I had no idea it would manifest in such odd behavior - the program works for some time, then hangs up. Seemed like typical overrun error, when some garbage is pushed in the memory area where it spoils the program.

DavidEGrayson commented 9 years ago

It sounds like this is a power issue. We have tested the library with more than 86 LEDs before.