Hi FastLed.Community, I need a quick help, searched github for hours,

Hi FastLed.Community,
I need a quick help, searched github for hours, but found no solution…
Does anybody know how to use FastLed to declare two separate strips within one LED-Strip thats connected to one physical GPIO?
Example:
10-LED-Neopixelstrip on Pin 13,
LEDs #0-4 defined as ProgressStrip,
LEDs #5-9 defined as IntensityStrip.
So, that i can use FastLED-functions like sinelon() or confetti() on one half of the strip without thinking about controlliing the other half.
Hi from Berlin and thanks for your help!

What about something like this:

Create two extra CRGB arrays at the top of your program for each section.

#define NUM_LEDS 10 //total
#define NUM_A 5 //number in A
#define NUM_B 5 //number in B

CRGB leds[NUM_LEDS];
CRGB ledsA[NUM_A];
CRGB ledsB[NUM_B];

In the main loop, do stuff for ledsA section
(Note, using NUM_A and ledsA here)

for(uint8_t i=0; i<NUM_A; i++) {
ledsA[i] = CHSV(hue++, 255, 255);
}

Then do different stuff for ledsB section

fill_rainbow( ledsB, NUM_B, millis()/40);

Finally, copy pixels from ledsA and ledsB to leds before showing.

for (uint8_t i=0; i<NUM_A; i++) {
leds[i] = ledsA[i];
}

for (uint8_t i=0; i<NUM_B; i++) {
leds[i+NUM_A] = ledsB[i];
}

FastLED.show();

This can be done without copying.

#define NUM_A 5
#define NUM_B 5
#define NUM (NUM_A+NUM_BB)

CRGB leds[NUM];
CRGB *ledsA = leds;
CRGB *ledsB = leds+NUM_A;

In this example, ledsA will point to the same memory as leds, and ledsB will point to the 6th element of leds. Now, you can work with ledsA and ledsB independently, minding their sizes of course, but as they both are parts of leds, the leds is the one you use to show.

Cool, thank you @Kirill_Kolyshkin .

The other way of doing this is to use CRGBArray which is now working well, you can pretty much ignore the warnings :wink: