Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uart branch flickers and flahes with 150 neopixels #38

Closed
weboide opened this issue Dec 29, 2015 · 5 comments
Closed

Uart branch flickers and flahes with 150 neopixels #38

weboide opened this issue Dec 29, 2015 · 5 comments

Comments

@weboide
Copy link

weboide commented Dec 29, 2015

Doing a simple animation with 150 neopixels lighting up one neopixel after the other (code below), part of the strand flashes randomly. (see https://www.youtube.com/watch?v=BjJZworuFgM)
I've got the Huzzah ESP8266 set up at 160Mhz in the Arduino IDE with the Uart branch of NeoPixelBus and the Esp Arduino library version 2.0.0. (Arduino 1.6.5)

#include <NeoPixelBus.h>

#define pixelCount 150 // this example assumes 4 pixels, making it smaller will cause a failure
#define pixelPin 2  // make sure to set this to the correct pin

#define colorSaturation 128

NeoPixelBus strip = NeoPixelBus(pixelCount, pixelPin);

RgbColor red = RgbColor(colorSaturation, 0, 0);
RgbColor green = RgbColor(0, colorSaturation, 0);
RgbColor blue = RgbColor(0, 0, colorSaturation);
RgbColor white = RgbColor(colorSaturation);
RgbColor black = RgbColor(0);

void setup()
{
    // this resets all the neopixels to an off state
    strip.Begin();
    strip.Show();
}

void wipe(RgbColor col)
{
    for (uint8_t pixel = 0; pixel < pixelCount; pixel++)
    {
      strip.SetPixelColor(pixel, col);
      strip.Show();
      delay(31); // 31ms ~= 30hz?
    }
}

void loop()
{
    wipe(red);
    wipe(black);

    wipe(green);
    wipe(black);

    wipe(blue);
    wipe(black);

    wipe(white);
    wipe(black);
}
@Makuna
Copy link
Owner

Makuna commented Dec 29, 2015

Could you experiment and see if can find at what count it does consistently work? 49?

@weboide
Copy link
Author

weboide commented Dec 29, 2015

48 is when it starts flashing, before that pixels #1 through #pixelCount are lighting up correctly and seem stable (although some pixels beyond #pixelCount are lighting up and stay on for some reason, probably due to no reset being sent to them).

@Makuna
Copy link
Owner

Makuna commented Dec 29, 2015

I submitted some changes to the uartdriven branch, could you try these. Let me know the results. Again, try the 49 and then try the full count.

@weboide
Copy link
Author

weboide commented Dec 29, 2015

Nice Job! the flashes stopped! I tried with 49 and with 150 and even decreased my delay to 1 (instead of 31) and things are smooth!

@Makuna
Copy link
Owner

Makuna commented Dec 29, 2015

fixed with pull #39

@Makuna Makuna closed this as completed Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants