I have yet to successfully program the new fill_gradient() feature of 2.1, every time I only get the first and last LED to light up, with black in between them. Egh?!
Would you share your code?
I’ve been calling it mostly like this:
fill_gradient( leds, 0, startColor, NUM_LEDS-1, endColor);
The colors have to be CHSV colors (not CRGB).
Here are my settings:
fill_gradient(leds, 1, CHSV(0,255,255), NUM_LEDS, CHSV(20,255,255), SHORTEST_HUES);
void fill_gradient( struct CRGB* leds,
uint16_t startpos, CHSV startcolor,
uint16_t endpos, CHSV endcolor,
TGradientDirectionCode directionCode = SHORTEST_HUES )
The positions are zero-based. They should run from 0 to NUM_LEDS-1. E.g. if you have 100 leds, the positions should be from 0…99.
That was the problem, thanks for the response!
Excellent! Happy to help and thank you for giving it a workout. Please let us know if you hit problems, or post pics if it works!
I really like the ease of switching between the HUE range i.e SHORTEST_HUES, LONGEST_HUES.
Wow! I missed that there was a fill_gradient function. I do this in my own code right now, but it will be nice to have it in the core library!
I didn’t see this mentioned on the G+ site. Did I miss it, or does this imply that I need to be reviewing the FastLED code more thoroughly?
This is a 2.1 beta feature. You kinda have to search for this stuff in the code/.h files in the library
I just recently set myself up with Github and now keep an up-to-date copy of the 2.1 branch checked out. Given how frequently new surprises get added (thanks to @Mark_Kriegsman and @Daniel_Garcia !), I’ll definitely peruse the code before too long.