Through some experimentation, I have noticed two things:
- using UCS1903 in approx 450 bytes larger than using UCS1903B
- but, when I use UCS1903B, FastLED.delay() is affected. The animations are slower, which is the opposite of what I thought would happen.
The UCS1903 requires more delay loops (since it only runs at 400khz) than the UCS1903B (since it runs at 800khz). Because the loop is completely unrolled on the arduino this is going to add quite a few opcodes. 450 bytes is consistent with 9 extra opcodes per bit, given that there’s 3 spots where delay occurs, and the long delay loop is 3-6 opcodes, that lines up.
What do you mean by “FastLED.delay” is affected? Note - FastLED.delay does not currently account for how long it takes to run show - it just checks to see whether or not there’s still time to delay and will call show again - it’s possible that at 800khz, there’s enough time that it’s actually spending more time in FastLED.delay than at 400khz. I haven’t had a chance to fine tune that to not call show if there’s less time left to delay than it would take to call show.
You are there. Say I have FastLED.delay(60) with UCS1903, and I want to throw a pixel up the strip. There is a distinct difference between the 400khz and 800khz strip options, in how much time it takes to move the pixels. Am I going about the new delay feature wrong?
How much difference? How many LEDs?
If it takes 61ms to write out a frame at 400lhz and 29 at 800khz (the clock timings are not exactly halved), then a FastLED.delay(60) will write one frame for 400khz (61ms) and 3 frames for 800lhz (87ms) - this is what I mean when I say I haven’t tuned FastLED.delay to take into account how long it takes to write a frame yet.
My rig only has 10 leds. I think the effect I am seeing is due to the fact, as you mentioned, that the library doesn’t take into account the time it takes to write a frame out to the leds. That’s no biggie. I have been trying to port in new code from previous FastLED versions, and the new 800 khz version for my strips is something I’m trying to incorporate into the code. I have noticed that I have some animations that look great without any delay in my code. Using 2.1, I HAVE to use FastLED.delay(1) to make it look good without the flicker. Is there a better way? Or am I using it correctly?