About Theatre Chase effect on LED strip with WS2812b


I imitate theatre chase sample code in the Tweaking4All website on my LED strip, but the effect of my The light strip becomes a stroboscopic effect instead of Theatre Chase effect.

my code is as follows:

void theaterChase(uint8_t red, uint8_t green, uint8_t blue, int SpeedDelay) 
  for (int j=0; j<10; j++) 
  {  //do 10 cycles of chasing
    for (int q=0; q < 3; q++) {
      for (int i=0; i < LED_FRAME_SIZE; i=i+3) {
        setPixel(i+q, red, green, blue);    //turn every third pixel on
      for (int i=0; i < LED_FRAME_SIZE; i=i+3) {
        setPixel(i+q, 0,0,0);        //turn every third pixel off

the LED_FRAME_SIZE is all LEDs in my LED strip.

I also upload my LED strip video on youtube. (https://youtu.be/KWtwIEMgigA)

Please guide me what's wrong on my code.


Why do users choose to ignore the advice on posting code ?

The easier you make it to read and copy your code the more likely it is that you will get help

Please follow the advice given in the link below when posting code , use code tags and post the code here

If you get errors when compiling please copy them from the IDE using the "Copy error messages" button and paste the clipboard here in code tags

Why would they need to read the instructions? :roll_eyes:

So in both these for-loops, you skip 2 leds. Is that intentional?

Shouldn't you be also doing that after turning pixels off?

Also asked here: https://www.tweaking4all.com/forum/arduino/about-theatre-chase-effect-on-led-strip-with-ws2812b/.

The Tweaking4All Theatre Chase in Wokwi simulation: https://wokwi.com/arduino/projects/301459608054006282

The problem is often a weak power supply, or a missing capacitor at the first led, or a signal that is too low (from a ESP8266 for example). Does it work with a normal delay() ?

Hi Koepel,

I also found the output voltage is too low (about 3.xV) normal is 4.5V~5V , so I will debug first.

Thanks for the information.