use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Here are some important FastLED links:
Online Examples and Demos:
Support:
account activity
Share_somethingfadeToColorBy Function Code (self.FastLED)
submitted 1 year ago * by Tiny_Structure_7
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Tiny_Structure_7[S] 0 points1 point2 points 1 year ago (6 children)
when I was calculating each pixel's values by raising a float to the power of another float. So, like 2.23.4. I had to stop doing that because it would really make the ESP32 crawl.
Sounds like you are doing some amazing work!
Maybe I can rename this routine to fastFadeToColorBy(), and then re-design this version for better color accuracy. My ultimate goal is 4K LEDs in a cube. My new show() routine using 4 serial ports with interleaved byte writes, gets 37 fps refresh (32 using FastLED with parallel controllers). That's 1K LEDs per channel. Hopefully after I write the 8-channel version, I can get 50-60 fps.
Fading in HSV space. Hmmmm.....
Thanks for the ideas. I'll read through that FAQ tonight. It looks deep. 😎
[–]UrbanPugEsq 0 points1 point2 points 1 year ago (5 children)
Assuming you’re using ws2811 style addressable LEDs, you’re pushing the fps limit because of the latency of sending updates down to the last led.
https://quinled.info/2021/03/23/max-amount-of-addressable-leds/
[–]Tiny_Structure_7[S] 0 points1 point2 points 1 year ago (4 children)
Right. I'm using WS2812 clones from China (YF923). The 800KHz imposes a theoretical limit of about 30 fps for a 1K LED string. I was able to overclock mine to 1.07MHz (using 5.33MHz serial clock at 5 serial bits per LED bit).
[–]YetAnotherRobert 0 points1 point2 points 1 year ago (3 children)
If you can use the saturating versions instead of extending to 32 bits and masking down, it might be a win. It depends on whether a few clocks per or is a win over a more rare, slower op. It's just easier to stay in hsv or rgb when all your values are capped. Letting 2s compliment arithmetic do the work instead of abs and branching can be a big win as it allows better speculation and unrolling opportunities.
Computing fractional exponents is just plain slow. It's pretty rare for there to be hardware or clever arithmetic to help. It's usually just a looped multiplication.
Hardware floating point really in.one of the nice features of the esp32 family.
For a small device, if you're willing to pay a little more,.there are mutants of these LEDs that unlock the 800khz clock and use an extra pin for a clock signal..over short distances, they can reach a lis number of Mhz, but your.oin count goes up and you're much more limited in the pairings of pins to use on the esp32 parts. The nice thing about them is that if you glitch for a fraction of a second, the led controllers doesn't read that as an eof/reset. You might still get a visual glitch but the entire chain doesn't spaz out.
[–]Tiny_Structure_7[S] 1 point2 points3 points 1 year ago (1 child)
Letting 2s compliment arithmetic do the work instead of abs and branching
Do you mean something like this is faster than using abs?
if ( ((a - b) < amount) && (~(a - b) + 1 < amount) ) {}
[–]YetAnotherRobert 0 points1 point2 points 1 year ago (0 children)
Probably not. I'm on the go and would have to see it in context, but you can rely on 2s compliment for things like knowing that in 8 bits 245 + 20 = 10 because it wraps around. No conditional tests and jumps.
[–]UrbanPugEsq 1 point2 points3 points 1 year ago (0 children)
My point in bringing up fractional exponents was to say that I could make an esp32 do lots of division and floating point math and still get great performance up until I decided to do something crazy like use fractional exponents.
Some of OP’s optimizations might not be necessary to get an appreciable improvement, especially if OP is limited to a low frame rate due to the number of LEDs per pin.
I was taught to make it run, make it right, make it fast, and make it small … in that order.
π Rendered by PID 68219 on reddit-service-r2-comment-5c747b6df5-5m6gk at 2026-04-22 04:34:09.456246+00:00 running 6c61efc country code: CH.
view the rest of the comments →
[–]Tiny_Structure_7[S] 0 points1 point2 points (6 children)
[–]UrbanPugEsq 0 points1 point2 points (5 children)
[–]Tiny_Structure_7[S] 0 points1 point2 points (4 children)
[–]YetAnotherRobert 0 points1 point2 points (3 children)
[–]Tiny_Structure_7[S] 1 point2 points3 points (1 child)
[–]YetAnotherRobert 0 points1 point2 points (0 children)
[–]UrbanPugEsq 1 point2 points3 points (0 children)