Hi all,
I have 3 WS2812B strips with different lengths. I would like to control each of them from separate data pins on the same controller. For now, I'm sending each strip the same animation.
The issue is that only one strip will activate. For example, the code below results in only the LARGE strip lighting up. If I comment out the LARGE animation (in the loop), then the MEDIUM strip will light up.
I'm going nuts debugging, so I'm starting to think that I am missing a fundamental concept here.
#include <FastLED.h>
#define DATA_PIN_SMALL 0
#define DATA_PIN_MEDIUM 1
#define DATA_PIN_LARGE 2
#define NUM_LEDS_SMALL 12
#define NUM_LEDS_MEDIUM 20
#define NUM_LEDS_LARGE 43
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB Small[NUM_LEDS_SMALL];
CRGB Medium[NUM_LEDS_MEDIUM];
CRGB Large[NUM_LEDS_LARGE];
#define BRIGHTNESS 96
#define FRAMES_PER_SECOND 120
void setup() {
delay(3000);
FastLED.addLeds< LED_TYPE, DATA_PIN_SMALL, COLOR_ORDER >(Small, NUM_LEDS_SMALL).setCorrection(TypicalLEDStrip);
FastLED.addLeds< LED_TYPE, DATA_PIN_MEDIUM, COLOR_ORDER >(Medium, NUM_LEDS_MEDIUM).setCorrection(TypicalLEDStrip);
FastLED.addLeds< LED_TYPE, DATA_PIN_LARGE, COLOR_ORDER >(Large, NUM_LEDS_LARGE).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
// Animation for Small Strip
fadeToBlackBy( Small, NUM_LEDS_SMALL, 5);
int posSmall = beatsin16( 13, 0, NUM_LEDS_SMALL-1 );
Small[posSmall] += CHSV( 160, 255, 192);
// Animation for Medium Strip
fadeToBlackBy( Medium, NUM_LEDS_MEDIUM, 5);
int posMedium = beatsin16( 13, 0, NUM_LEDS_MEDIUM-1 );
Medium[posMedium] += CHSV( 160, 255, 192);
// Animation for Medium Strip
fadeToBlackBy( Large, NUM_LEDS_LARGE, 5);
int posLarge = beatsin16( 13, 0, NUM_LEDS_LARGE-1 );
Small[posLarge] += CHSV( 160, 255, 192);
FastLED.show();
FastLED.delay(1000/FRAMES_PER_SECOND);
}