ws28128-rpi
ws28128-rpi copied to clipboard
Bugs
Hi jazzycamel,
I'm not a GIT user so not sure how to submit a bug report. In ws2812-rpi.cpp theaterChase... the boundary tests should be against "i+q" otherwise you end up trying to set a pixel or two that doesn't exist if the pixel count is not divisible by 3. Here's the fix anyway.
void NeoPixel::theaterChase(Color_t c, uint8_t wait) {
unsigned int j, q, i;
for (j=0; j<15; j++) {
for (q=0; q < 3; q++) {
for (i=0; i+q < numPixels(); i=i+3) {
setPixelColor(i+q, c);
}
show();
usleep(wait * 1000);
for (i=0; i+q < numPixels(); i=i+3) {
setPixelColor(i+q, 0, 0, 0);
}
}
}
}
void NeoPixel::theaterChaseRainbow(uint8_t wait) {
int j, q, i;
for (j=0; j < 256; j+=4) {
for (q=0; q < 3; q++) {
for (i=0; i+q < numPixels(); i=i+3) {
setPixelColor(i+q, wheel((i+j) % 255));
}
show();
usleep(wait * 1000);
for (i=0; i+q < numPixels(); i=i+3) {
setPixelColor(i+q, 0, 0, 0);
}
}
}
}
Also, would be sensible to limit the brightness to "brightness" in the effectsdemo - mine came on at full brightness and it was dazzling!
I forgot to say "thank you" for making this available! Thank you.