strip mirroring!
2 strips of 16 leds, put on pins 3 and 4, using the;
CRGB ledsA[NUM_LEDS_PER_STRIPA];
CRGB ledsB[NUM_LEDS_PER_STRIPB];
FastLED.addLeds<WS2812B, DATA_PINA, GRB>(ledsA, 0, NUM_LEDS_PER_STRIPA); FastLED.addLeds<WS2812B, DATA_PINB, GRB>(ledsB, 0, NUM_LEDS_PER_STRIPB);
and a tweaky pattern;
void rotatingDots (int speed1, int hue1, int speed2, int hue2, int speed3, int hue3, int fadeSpeed) {
ledsA[pos1] += CHSV(hue1, 255, 255);
ledsA[pos2] += CHSV(hue2, 255, 255);
ledsA[pos3] += CHSV(hue3, 255, 255);
ledsB[pos1] = ledsA[pos1];
ledsB[pos2] = ledsA[pos2];
ledsB[pos3] = ledsA[pos3];
EVERY_N_MILLISECONDS (10) {
pos1=map(sin8(millis()/speed1), 0, 255, 0, NUM_LEDSA);
pos2=map(sin8(millis()/speed2), 0, 255, 0, NUM_LEDSA);
pos3=map(sin8(millis()/speed3), 0, 255, 0, NUM_LEDSA);
fade=fadeSpeed;
}
}
now this works beautifully for the 2 strips showing the same pattern, but some of the patterns i would like to be synced (as above) and then a choice to mirror them.
now ive given changing the array around, but it seems to just not work;
int mirrorLeds[16] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
void mirrorMe() {
if ( MIRROR == 1 ) { for (int i=0; i<16; i++) { ledsB[i] = mirrorLeds[i];
} else {
for (int i=0; i<16; i++) { ledsB[i] = [i]; }
}
}
} // end of void mirrorMe
the theory being that i can remap the address’s on the fly.