looking for help using Multiple Controller Examples is it possible to add multiple string

fastled-support
gplus
(Progress Group) #1

looking for help using Multiple Controller Examples

is it possible to add multiple string with different numbers of led defined per string

I have compiled the following code but not sure if there is a better way?

#include <FastLED.h>

#define NUM_LEDS_PART_1 154
#define NUM_LEDS_PART_2 158
#define NUM_LEDS_PART_3 133
#define NUM_LEDS_PART_4 140
#define NUM_LEDS_PART_5 150
#define NUM_LEDS_PART_6 148
#define COLOR_ORDER GRB
#define BRIGHTNESS 128
#define DELAY 10

CRGB ledsA[NUM_LEDS_PART_1];
CRGB ledsB[NUM_LEDS_PART_2];
CRGB ledsC[NUM_LEDS_PART_3];
CRGB ledsD[NUM_LEDS_PART_4];
CRGB ledsE[NUM_LEDS_PART_5];
CRGB ledsF[NUM_LEDS_PART_6];

void setup() {
FastLED.addLeds<WS2812, 1>(ledsA, NUM_LEDS_PART_1);
FastLED.addLeds<WS2812, 2>(ledsB, NUM_LEDS_PART_2);
FastLED.addLeds<WS2812, 3>(ledsC, NUM_LEDS_PART_3);
FastLED.addLeds<WS2812, 4>(ledsD, NUM_LEDS_PART_4);
FastLED.addLeds<WS2812, 5>(ledsE, NUM_LEDS_PART_5);
FastLED.addLeds<WS2812, 6>(ledsF, NUM_LEDS_PART_6);
}

(JP Roy) #2

Yes it is definitely possible. I have built a Xmas tree using an Arduino MEGA with 34 different pins used. Each pin was driving a separate branch of my tree (34 branches) and each branch having a different number of WS2811 LED ranging from 4 to 13.

I am not sure about you syntax however but maybe it is fine…
Here’s a few of the addLeds from my own setup that definitely work…

FastLED.addLeds<WS2811, 52>(leds, 0, 13); // White branch #1
FastLED.addLeds<WS2811, 50>(leds, 13, 13); // White branch #2
FastLED.addLeds<WS2811, 19>(leds, 26, 13); // White branch #3
FastLED.addLeds<WS2811, 20>(leds, 39, 13); // White branch #4
FastLED.addLeds<WS2811, 21>(leds, 52, 13); // White branch #5
FastLED.addLeds<WS2811, 40>(leds, 65, 13); // White branch #6

FastLED.addLeds<WS2811, 38>(leds, 78, 12); // Orange branch #1
FastLED.addLeds<WS2811, 36>(leds, 90, 12); // Orange branch #2
FastLED.addLeds<WS2811, 32>(leds, 102, 12); // Orange branch #3
FastLED.addLeds<WS2811, 30>(leds, 114, 12); // Orange branch #4

FastLED.addLeds<WS2811, 28>(leds, 126, 11); // Grey branch #1

etc… etc…

(Progress Group) #3

@JP_Roy thanks roy