Hello everybody,
I have played A little bit with Fast LED 2.1 and something went wrong with the gradient, because there was a lot of flickering! I’m using a TM1809@12V(FastLED.addLeds<TM1809, 5,BRG>(leds, NUM_LEDS)
And in the first seconds of the is the Rainbow effect which is very nice in a loop(fill_rainbow( &(leds[0]), 30 /led count/, k /starting hue/);).
When I push the Button the first LEDs make a Gradient(fill_gradient(leds,0,CHSV(0,0,0),19,CHSV(120,255,255),SHORTEST_HUES)
but then the whole Stripe has flickering. How is that possible? Any suggestions? Thanks.

Thanks for posting the video-- it really helps show what you’re seeing!
It looks to me like a power problem, but now I also want to go and check the library code to make sure there aren’t problems there.
Could you post some of your sketch code, too?
In order to give you some help, we really need to see the context in which the fill_gradient function is being called. Can you post your entire code (or at least the lines involved with the gradient issue)?
Thanks for the fast response. I have simplified it a little bit and I have tested it its the same, the Rainbow is fine, but the Gradient has flickering. I have a teensy 3.1 @48Mhz. Here is the Code:
#include “FastLED.h”
// How many leds in your strip?
#define NUM_LEDS 20
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<TM1809, 5,BRG>(leds, NUM_LEDS);
}
void loop() {
fill_gradient(leds,0,CHSV(0,0,0),19,CHSV(120,255,255),SHORTEST_HUES);
//fill_rainbow( &(leds[0]), 19 /led count/, k /starting hue/);
FastLED.show();
}
Hmm. I don’t see anything obviously wrong, although you don’t have code for how the variable k is being defined or set. Here is the code I’m using in my Circles project. Maybe seeing this will give you a clue?
uint8_t gradientStart = 0;
uint8_t gradientEnd = 45;
unsigned long endTime = millis() + 30000;
while (millis() < endTime)
{
fill_gradient(m_pLeds, 0, CHSV(gradientStart % 255, DEFAULT_SATURATION, DEFAULT_BRIGHTNESS), NUM_LEDS - 1, CHSV(gradientEnd % 255, DEFAULT_SATURATION, DEFAULT_BRIGHTNESS), SHORTEST_HUES);
gradientStart--;
gradientEnd--;
FastLED.delay(50);
}
I also just noticed that you are using different starting and ending values for saturation and value, as well as hue. Maybe this is supported, but for testing purposes you might want to set those to 255 for both starting and ending and see if it behaves any differently.
thanks, I will test it, but which value has Default Saturation and default Brightness?
Those are constants I defined in my code, just to make it easier to change (I refer to them all throughout the code). In my case they are both currently set to 255. For your code, I would try this:
fill_gradient(leds,0,CHSV(0,255,255),19,CHSV(120,255,255),SHORTEST_HUES);
And disregard my comment about “k”. I see now that was used on the commented-out fill_rainbow call.
So - it turns out there’s two sets of values that I need to track for these chipsets. There’s the “latch time” - which is “how long do I have to not send data for until the leds will start receiving new data” - but then there’s also the “max update rate” - if you update these leds faster than their internal pwm rate - you can get all sorts of weird things happening. With the WS2812’s this is around 400hz. With the TM1809 - i’m not sure what it is, but it might be similar. When you have lots of leds, it’s less of a problem because it takes you longer to write out a frame than it takes for one of the led chips to go through its full PWM cycle - but when you only have a few leds - like the 20 you have anove, it is way too easy to go too fast. Try throwing a delay(50) or some such in there to forcibly cap you at about 200fps and see if that helps.
(I will be adding code, likely once i’m finished building locus, that will enforce the max fps rate)
I bet that Dan is spot on: the library is out-running the LEDs.
Also, I missed this before, but I see you are calling fill_gradient, and then calling FastLED.show. The show call isn’t needed (fill_gradient does an implicit show), and may be aggravating the frame rate issue.
If fill_gradient is doing an implicit show, that’s leftover debug code that I’ll shortly take out.
FastLED.show() is always needed explicitly; the fill_ functions just store values in the leds[] array (or wherever you tell them to).
Good to know! If you look at my code above, there is no call to show, so I assumed this was expected behavior. I’ll be sure to update my code (everywhere) accordingly.
Thanks, @Dave_Morgan I have tested your code it works fine. I will try to slow it down.
Here’s the trick: FastLED.delay() will (repeatedly!) update the LED strips as long as there’s time left to do it before the delay time runs out.
So often calling FastLED.delay() will result in calls to FastLED.show().
And I just checked the 2.1 code in github and there’s to leftover call to show() in it.
Always worth checking though…
I now know the source of my confusion. I frequently end patterns with something like FastLED.delay(5000); so that I can have a bit of time to analyze the results. I previously used delay, but changed everything to FastLED.delay when it was added. Your comment above reminded of what FastLED.delay is really doing. 
I have tested it. If I write in my Code the same HSV values like Dave it works, no flickering. (fill_gradient(leds,0,CHSV(0,255,255),19,CHSV(170,255,255),SHORTEST_HUES)
But if I have darker values(fill_gradient(leds,0,CHSV(0,0,0),19,CHSV(170,255,255),SHORTEST_HUES)
I have flickering. FastLED.delay(100) between the show() hasn’t made any difference.
@Dave_Morgan
If I change the Value in the first CHSV from 255 to 0 your code flickers the same 
Ok, I’ll take a look tonight when I have a test rig handy.
Could you please post a short complete example that shows the problem as you see it now, and I’ll see if I can reproduce it and investigate?
Thanks Mark! That would be great! I Think its in general a problem with darker values in TM1809.
Here is my code:
#include “FastLED.h”
#define NUM_LEDS 20
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<TM1809, 5,BRG>(leds, NUM_LEDS);
}
void loop() {
//fill_gradient(leds,0,CHSV(0,255,255),19,CHSV(200,255,255),SHORTEST_HUES);
// works perfect
//fill_gradient(leds,0,CHSV(0,0,0),19,CHSV(100,255,255),SHORTEST_HUES);
// has flickering
fill_solid( &(leds[0]), 19 , CHSV( 0, 0, 2) );
// has also flickering
FastLED.delay(100);
//FastLED.show();
}