r/FastLED • u/dheadrick1618 • Dec 09 '25
Discussion Can someone summarize why FastLED must be used with the arduino framework as a component included, when trying to use FastLED with ESP-IDF based projects?
As the title suggests, I am curious if someone could summarize why FastLED is so tightly coupled to the Arduino framework? What 'parts' of the Arduino framework are required / used by FastLED, and what are the reasons preventing it from being decoupled so it can be used natively with either Arduino framework, or the ESP idf framework?
I've seen this port for FastLED v4, although I do not want to use it in a new project given its been over 5 years since its been updated and seems to no longer be maintained.
It has been many years since I have worked with any of these things, but I recall in the past also requiring something like a 1ms delay in the main 'loop' , otherwise a watchdog would fire and crash the code immediately (I guess this also means that we require some sort of 'main' loop regardless of if we are using it and instead have all our tasks 'pinned to cores'). Given the clock speed the ESP32 is capable of, this feels like being forced to drive a ferrari with only 2 wheels...
I am curious how many other limitations are introduced when using the arduino framework for an esp-idf project, and any help pointing me to some explanation on this would be greatly appreciated.
15
u/ZachVorhies Zach Vorhies Dec 09 '25 edited Dec 09 '25
It's coupled because it's challenging to decouple it. Arduino hardware abstraction layer is awesome. I've been slowly chopping away at the libarduino and cutting headers but always get my hand caught in a mouse trap. Idf 4, 5, and now 6. Multiply that by something like 8 platforms.
If I remove the Arduino HAL then I have to create my own HAL, which is exactly what I'm doing but few are asking for it so it's not a high priority.
3
u/eshkrab Dec 09 '25
Quite a number of years ago I’ve ported fastLED to esp-idf without the arduino component, you just have to go in and swap the arduino specific HAL calls within the implementation for (and there was a number of millis calls which it was easier to just redefine millis than hunt down everywhere in the codebase) This was before the i2s peripheral implementation, i2s in newer esp-idf is a little annoying cause espressif made their own higher level abstractions to make the regular usage of i2s easier. I’ve sat down to try to rip out just that part a couple of times for esp-off native led lib since (not in the past year, year and a half) and haven’t gotten it working but one day…
-1
u/zuptar Dec 09 '25
I dot know about esp's specifically as I use other chips, it's not specifically coupled. Fastled is just a maintained code base designed for outputting correctly to pins in a way that minimises the potential for error. (it gets the timing right to send data to each led correctly).
It's open source though, so you dont specifically need arduino, it's just if you're in the arduino ide, its nicely packaged to just install and work. If you're outside arduino you may have more challenge compiling since most device ides are C and arduino is c++ (which compiles to c before assembly)
I think a lot of esp's are dual core, so you can run your fastled code without interrupts impacting the output. On other platforms you have to solve it some other way. Eg. I use fastled dma driver for arduino nano 33 and it outputs fine, interrupts and such slow down framerate but never impact the actual ouput to LEDs.
Pretty sure Ai could have answered better than me.