Hi all
I want to duplicate data from one pin to another pin. duplication works fine with this code.
line1 [pixel ] = CHSV(beatA, 0, 255);
line2 [pixel ] = CHSV(beatA, 0, 255);
line3 [pixel ] = CHSV(beatA, 0, 255);
LEDS.show();
line1 [pixel ] = CHSV(beatA, 255, 255);
line2 [pixel ] = CHSV(beatA, 255, 255);
line3 [pixel ] = CHSV(beatA, 255, 255);
but to make it simpler and I tried with this code, but it doesn't work.
line1 [pixel ] = line2 [pixel ] = line3 [pixel ] ;
how to simply duplicate data to another pin. Thank You.
#include <FastLED.h>
#define NUM_LEDS 32
#define BRIGHTNESS 200
CRGB line1[NUM_LEDS];
CRGB line4[NUM_LEDS];
CRGB line2[NUM_LEDS];
CRGB line3[NUM_LEDS];
#define outLine1 2 //strip output
#define outLine4 13
#define outLine2 12 //strip output
#define outLine3 11
void setup() {
delay(1000);
FastLED.addLeds<WS2812B, outLine1, GRB>(line1, NUM_LEDS);
FastLED.addLeds<WS2812B, outLine4, GRB>(line4, NUM_LEDS);
FastLED.addLeds<WS2812B, outLine2, GRB>(line2, NUM_LEDS);
FastLED.addLeds<WS2812B, outLine3, GRB>(line3, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
pattern1();
LEDS.show();
}
int pixel = 0;
void pattern1() {
fadeToBlackBy( line1, NUM_LEDS, 10);
uint8_t beatA = beatsin8(80, 5, 255);
line1 [pixel ] = CHSV(beatA, 0, 255); //CHSV(random8(), 255, 255);
LEDS.show();
line1 [pixel ] = CHSV(beatA, 255, 255); //CHSV(random8(), 255, 255);
EVERY_N_MILLISECONDS(20) {
pixel++;
if ( pixel >= NUM_LEDS ) {
pixel = 0;
}
}
line1 [pixel ] = line2 [pixel ] = line3 [pixel ] = line4 [pixel ] ;
}