Array of logical strips

Hi,

I have 3 strips with 20 leds each.
CRGB leds[3][20];
FastLED.addLeds<WS2812B, 2, GRB>(leds[0], 20);
FastLED.addLeds<WS2812B, 3,GRB>(leds[1], 20);
FastLED.addLeds<WS2812B, 4,GRB>(leds[2], 20);

Can I split them so I have 6 'logical' strips?
Then I can treat them as if I have an array of 6 elements.

In English:
Array[0] = Strip[0] LedNos[0-9]
Array[1] = Strip[0] LedNos[10-19]
Array[2] = Strip[1] LedNos[0-9]
Array[3] = Strip[1] LedNos[10-19]
Array[4] = Strip[2] LedNos[0-9]
Array[5] = Strip[3] LedNos[10-19]

...Rob

Welcome to the forum

The FastLED library supports the concept of zones within a single strip but I don't know whether this is applicable to what you are trying to do

In short:

I have 3 physical strips and I want to use them as 6 logical strips, so I can use functions on 1 (logical) strip as a whole

Because repeating the same as you already posted will make it more clear?

FastLED has features enough to fill a book. See if there's a FastLED site, maybe they have some kind of map or table of contents organized.

Can you post a simple schematic as to how you plan on connecting these. It appears electrialy you want to separate them but not physically. Also show power source for the LEDs as the Arduino a Power Supply it is NOT!

I searched on "zones" as what @UKHeliBob said.
I found an example for 1 ledstring an I edited it to this:

#include "FastLED.h"
#define NUM_LEDS 24
#define Data_Pin1 3
#define Data_Pin2 9
#define Data_Pin3 2
#define chipset WS2812B
#define BRIGHTNESS  50
#define COLOR_ORDER GRB

CRGB rawleds[3][NUM_LEDS];
CRGBSet ledsA(rawleds[0], NUM_LEDS);
CRGBSet ledsB(rawleds[1], NUM_LEDS);
CRGBSet ledsC(rawleds[2], NUM_LEDS);
CRGBSet ledsA1(ledsA(0,7));
CRGBSet ledsA2(ledsA(8,15));
CRGBSet ledsA3(ledsA(16,23));
CRGBSet ledsB1(ledsB(0,7));
CRGBSet ledsB2(ledsB(8,15));
CRGBSet ledsB3(ledsB(16,23));

struct CRGB * ledarray[] ={ledsA1, ledsA2, ledsA3, ledsB1, ledsB2, ledsB3, ledsC}; 

void setup() { 
  delay(2000); // power-up safety delay 
  FastLED.addLeds<chipset, Data_Pin1,COLOR_ORDER>(ledsA, NUM_LEDS); 
  FastLED.addLeds<chipset, Data_Pin2,COLOR_ORDER>(ledsB, NUM_LEDS); 
  FastLED.addLeds<chipset, Data_Pin3,COLOR_ORDER>(ledsC, NUM_LEDS); 
  FastLED.setBrightness(BRIGHTNESS);
}

void loop() { 

  fill_solid(ledarray[0], 8, CRGB::Orange);
  fill_solid(ledarray[3], 8, CRGB::Blue);
  fill_solid(ledarray[6], 8, CRGB::Red);
  FastLED.show();
  delay(700);

  fill_solid( ledarray[0], 8, CRGB::Black);
  fill_solid( ledarray[3], 8, CRGB::Black);
  fill_solid( ledarray[6], 8, CRGB::Black);
  FastLED.show();
  
  fill_solid(ledarray[1], 8, CRGB::Green);
  fill_solid(ledarray[4], 8, CRGB::Red);
  fill_solid(ledarray[6], 8, CRGB::Green);
  FastLED.show();
  delay(700);

  fill_solid( ledarray[1], 8, CRGB::Black);
  fill_solid( ledarray[4], 8, CRGB::Black);
  fill_solid( ledarray[6], 8, CRGB::Black);
  FastLED.show();

  fill_solid(ledarray[2], 8, CRGB::Purple);
  fill_solid(ledarray[5], 8, CRGB::Brown);
  fill_solid(ledarray[6], 8, CRGB::Blue);
  FastLED.show();
  delay(700);

  fill_solid( ledarray[2], 8, CRGB::Black);
  fill_solid( ledarray[5], 8, CRGB::Black);
  fill_solid( ledarray[6], 8, CRGB::Black);
  FastLED.show(); 
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.