rgb led strips, multiple strips different lengths

Help me out here.
I have three strips of RGB addressable of different lengths A 20 leds, B 15 leds, C 10 leds

which I have set up like this

#include "FastLED.h"
#define NUM_LEDS_PART_A 20
#define NUM_LEDS_PART_B 15
#define NUM_LEDS_PART_C 10

CRGB ledsA[NUM_LEDS_PART_A];
CRGB ledsB[NUM_LEDS_PART_B];
CRGB ledsC[NU
M_LEDS_PART_C];

I want to set void loop in such away that strip A and B will run the leds in a mirrored manner but different colours e.g yellow in A and blue in B while strip B runs independently.

I have noted that fastled runs one strip after another in this set up.

void loop() {
for (int i = 0; i <= 19; i++) {
ledsA = CRGB ( 255, 255, 0);

  • FastLED.show();*
  • delay(50);*
  • }*
  • for (int i = 0; i <= 19; i++) {*
    _ ledsA = CRGB ( 0, 0, 0);_
    * FastLED.show();*
    * delay(50);*
    * }*
    * for (int i = 0; i <= 14; i++) {*
    _ ledsB = CRGB ( 0, 0, 255);
    * FastLED.show();
    delay(40);
    }
    for (int i = 0; i <= 14; i++) {
    ledsB = CRGB ( 0, 0, 0);
    FastLED.show();
    delay(40);*_

* for (int i = 0; i <= 9; i++) {*
_ ledsC = CRGB ( 0, 255, 0);
* FastLED.show();
delay(40);
}
for (int i = 0; i <= 9; i++) {
ledsC = CRGB ( 0, 0, 0);
FastLED.show();
delay(40);*_

* } *
* }*

Assistance will be highly appreciated.

Hello waisam,
Welcome to the forum.

Please read the sticky 'how to use this forum - please read' at the top of this and every forum (there's a clue in the title), then go back and modify your post according to the instruction, particularly #7.

Thank you.

There is a library PololuAP102RGBLedStrip that makes using these addressable LED strip rather more easy.

I have noted that fastled runs one strip after another in this set up.

No surprise, that is exactly what that code will do.

You have a for loop that sets each LED then shows it then delays, so nothing can possibly happen to the other LEDs until one for loop is finished.

To run the strips independently you have to write your code as a state machine. This involves removing all the for loops and delays. There are lots of tutorials for this, look at this forum’s Demonstration code for several things at the same time - Project Guidance - Arduino Forum

Also look at the blink without delay example in the IDE.