Is there a way to fill_solid leds 1-50 and then 51-100 and then 101-120

Is there a way to fill_solid leds 1-50 and then 51-100 and then 101-120 etc.
I know I can set each individual led[0]. Thoughts?

@Trey_Coursey - Use CRGBSet to do what you want to do. See the following examples using CRGBSet:

and for solidfill with CRGBSet see:

I’m thinking I might could pull this off with a gradient palette. What I’m wanting is blink different segments of my house eave. I’ve counted the leds and know what series of leds I call a segment.

Unless there is a better way I think I’ll try the palette method

1 Like

@Ken_White I thought I understood what was going on here but when I upload to esp8266 it basically crashes. Maybe it’s overloaded or something else not sure. Just know I had to bring it down from house and hook it back to com port to upload new sketchs. Do you see anything that would cause mis behaviour?

I might add that this Function is being called inside the web server from Jason Coons and that’s why all of the other FastLED stuff is not shown around it. This is simply the “Pattern” so to speak.

@Trey_Coursey What is NUM_LEDS set to?

@Trey_Coursey - It is probably not working for the following reasons:

Your CRGBSet definitions (your lines 3-8) should be put into your sketch before your void setup.

Did you include lines 11 and 12 from my sketch:

CRGB rawleds[NUM_LEDS];

CRGBSet leds(rawleds, NUM_LEDS);

in your sketch?

The CRGBSet definition for leds1 (your line 4) should be:

CRGBSet leds1(leds(0,110));

Please note that the first led is 0 and not 1. The second number should be 110 if you have 111 leds in that block or 109 if you have 110 leds in that block. Therefore, you need to change the other ranges too.

In line 12, your number of leds in the array leds1 should be 111 (if your CRGBSet led1 goes from led [0] to led[110]) or 110 ( if your CRGBSet led1 goes from led [0] to led[109]). The other fill_solid statements should be changed, too. So it will be:

fill_solid(ledarray[0], 111, CRGB( 255, 255, 255)); //WHITE - 111 is number of elements (i.e. leds) in the array led1.

Sometime during the winter, I will change this to include code to calculate the size of each array and put it in functions where that number is needed and you will not have to hard code it in.

Also, it would be very helpful if you include your whole sketch in PasteBin, Gist or GitHub.

@Ken_White That makes sense now that you say that. The first lines are def setup stuff not things needing to be looped through. Let me look again tonight with those adjustments. It also might have to do with the LEDS not starting with 0 like you mentioned. I keep learning every day! Thanks so much.

@marmil 480 (3 strings of 160)

If NUM_LEDS is 480, then based on this:
CRGBSet leds5(leds(308,480));
You would be trying to address a pixel at the end there that doesn’t exist. Trying to write data to a pixel that doesn’t exist causes bad things to happen (memory on the controller being overwritten), which could be causing the lock up you’re having.

@marmil Yes I think I missed it needing to start a “0” so I am seeing some wierd things. I’m sure what you and Ken have directed me should help alot. Looking forward to trying the fixes tonight when I get home!

Hi I need to ask one thing that is there any another option for that working …I means that without using array .

While there is an archive of old Google+ FastLED content on Maker Forums, the FastLED community has requested that new conversation happen on Reddit:

1 Like