Hello. Please tell me how to do it.

Hello.
Please tell me how to do it.
How to divide the tape into multiple arrays and calls in code to specific arrays?
I.e
#define NUM_LEDS 100
NUM_LEDS_1 (0 to 30 pixel)
NUM_LEDS_2 (31 to 60 pixel)
NUM_LEDS_3 (61 to 100 pixel)
That is, I need one more virtual tape.
Thank you.

@04eba0d58c302007a349 - What you are looking for is CRGBSet. Use the “Search Community” box on the left of this webpage to search for “CRGBSet Ken White” or “CRGBSet Daniel Garcia” to find information on what you want to do.

A definition that i use:
#define NUM_LEDS 150
#define NUM_LEDS_1 17
#define NUM_LEDS_2 12
#define NUM_LEDS_3 7
#define NUM_LEDS_4 51
#define NUM_LEDS_5 7
#define NUM_LEDS_6 39
#define NUM_LEDS_7 17

CRGBArray<NUM_LEDS> leds;
CRGBSet leds_1(leds, 0, NUM_LEDS_1);
CRGBSet leds_2(leds, NUM_LEDS_1, NUM_LEDS_2);
CRGBSet leds_3(leds, NUM_LEDS_1+NUM_LEDS_2, NUM_LEDS_3);
CRGBSet leds_4(leds, NUM_LEDS_1+NUM_LEDS_2+NUM_LEDS_3, NUM_LEDS_4);
CRGBSet leds_5(leds, NUM_LEDS_1+NUM_LEDS_2+NUM_LEDS_3+NUM_LEDS_4, NUM_LEDS_5);
CRGBSet leds_6(leds, NUM_LEDS_1+NUM_LEDS_2+NUM_LEDS_3+NUM_LEDS_4+NUM_LEDS_5, NUM_LEDS_6);
CRGBSet leds_7(leds, NUM_LEDS_1+NUM_LEDS_2+NUM_LEDS_3+NUM_LEDS_4+NUM_LEDS_5+NUM_LEDS_6, NUM_LEDS_7);

Thank you very much!!!@Ken_White

Hello.
Thank you very much!!!
You helped me a lot!
Everything is working.
Can I hope that you will save the me again? )
I need to get rid of the delay (20);
To do so:
unsigned long currentTime;
void modx1() {
for(int i = 0; i < (0,100); i = i + 1) {
leds[i] = CRGB::Green;
FastLED.show();
// delay(20);
int OldTime=millis();
while((millis()-OldTime)<=20)
Serial.println(OldTime);
}
}
The trouble is that as soon as «OldTime» takes a negative value system stops working.
If to you will have free time for me, please tell me where I’m wrong.
Once again, thank you very much.
Alexander.
@Ezio_Perinot

unsigned long OldTime;

Hi Alexander,
If you want to take an action every n amount of time FastLED has 2 great function:
EVERY_N_MILLISECONDS(xx)
EVERY_N_SECONDS(xx)
In the examples (one is ColorWavesWhitPalettes) Mark uses both of them and you can see how they work.

(Use “FastLED.delay()” not “delay()” if you need a delay)
Hope it help you.

@Ezio_Perinot Thank you very much!
You saved me again!