Multiple String Array Noobish Question
I’ve got 8 LED strings defined on different pins (using teensy/octo adapter)
FastLED.addLeds<WS2812B, 2, GRB>(leds[0], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 14, GRB>(leds[1], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 7, GRB>(leds[2], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 20, GRB>(leds[3], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 6, GRB>(leds[4], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 9, GRB>(leds[5], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 21, GRB>(leds[6], NUM_LEDSPERROW);
FastLED.addLeds<WS2812B, 5, GRB>(leds[7], NUM_LEDSPERROW);
Variables:
#define NUM_LEDS 160
#define NUM_ROWS 8
#define NUM_LEDSPERROW 20
CRGB leds[NUM_ROWS][NUM_LEDSPERROW];
Using a simple colorwipe type function:
for(int i = 0; i < TotalSteps; i++ )
{
leds[Row][i] = CRGB::Red;
}
Now if TotalSteps is equal to the row length (number of LEDs) works as expected.
However, if for some reason TotalSteps is larger than the string length (number of leds), then the extra updates are bleeding into the next array.
Apart from being careful or adding checks on my number of leds per row, are there other ways to avoid this?
I suppose if I wanted to run code on all of the 8 strings as one array, I could essentially just use leds[0][NUM_LEDS]? my gut says no though.
current code:
really trying to get a good understanding on how to run multiple strips simultaneously with simple effects, but not quite clicking yet. May just defer back to the same effect on all the strings instead.
