Skip to content

Having Fastled.Delay must after Show while using FastLed on ESP32 Amazon FreeRtos #1049

Closed

Description

@pramodvb

Hi,
My Environment: ESP32 using FastLED along with AmazonFreeRTOS, connected with WS2812 LED Matrix of 8 LEDs x 8 LED
Code: FastLED.Show is called periodically in a High Priority task

Observation without calling Fastled.Delay after show,

  1. When I have 10 LEDs with Color Value and rest all with (0,0,0). In 1st call with FastLED.show only 9 LEDs glow. In the subsequent calls to FastLED, 10th LED also glow, but 3rd LED glows with altogether different color
  2. When I send command to lit all 8 x 8 leds with constant color. The flicker is observed randomly.

In order to address above:

  1. I just added FastLED.Delay with 40 mSec right after call to .Show(). There is no flicker and there no Wierd color for 3rd LED also.

I thought of adding FastLED.delay after show after reading a few articles that If OS switches to another task while all data is not yet transferred completely to LED Matrix hardware. Considering FastLED.delay as blocking I presume it just does not pass the control to OS prematurely and does the trick

So My Question is:
a) Do you recommend calling Fastled.Delay as above or is there a smarter way?
b) For larger number of LEDs, this delay needed would also be more, So how to know how much delay necessary. Also adding more and more delay, the task will just be on hold and there is no possibility of other tasks to function.

thanks

Activity

  1. SnowMB commented on Jul 10, 2020

    @SnowMB
    Contributor

    Hey I just wrote about a similar issue in #1037.

  2. 5chmidti commented on Jul 11, 2020

    @5chmidti
    Contributor

    show() and delay() are blocking, but there is one subtle difference in what delay() does.

    delay() calls show() as well. It basically calls show() until the amount of milliseconds that were requested as a delay have passed.
    But the notable thing about delay() is that it calls yield() after it's call to show().

    Try this:

    FastLED.show();
    yield();

    I'm not sure as to why show() doesn't just call yield() in the first place or why there aren't more people with this problem, if my assumptions are correct.

  3. firepower9966 commented on Jul 14, 2020

    @firepower9966

    What does yield do?

  4. 5chmidti commented on Jul 14, 2020

    @5chmidti
    Contributor

    Here is an explanation from stackoverflow.

    I have to say though, that I'm not sure if it fixes the problem because I don't know what/if anything would be done in the background. I also don't know amazons FreeRtos, but the yield call is the only difference between show() and delay() in the FastLED functions, except for the delaying part.

  5. added
    platform: esp32
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  6. moved this from Triage to Done in FastLED Trackeron Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreplatform: esp32status: stalestatus: triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions