Thanks, Marc. I see that class in the documentation, but for some reason I’m getting a no matching function for call, error.
Is there a better way to do this than the code below? I’d like a smooth transition from one color to the next, at the lowest point of the sine wave, but I’m still getting some flicker, and no colors for a few cycles.
EVERY_N_MILLISECONDS(30) {
int s = sin8(x);
if (x > 254 ) x = 0;
for (int j = 0; j < NUM_LEDS; j++) {
leds[j].setRGB(r, g, b);
leds[j].fadeLightBy(s);
}
FastLED.show();
if (s == 254) {
switch (col) {
case 0:
r = 255;
g = 0;
b = 0;
break;
case 1:
r = 255;
g = 255;
b = 255;
break;
case 2:
r = 0;
g = 0;
b = 255;
break;
}
col++;
if (col == 3) col = 0;
}
x++;
if (s == 254) {
switch (col) {
case 0:
r = 255;
g = 0;
b = 0;
break;
case 1:
r = 255;
g = 255;
b = 255;
break;
case 2:
r = 0;
g = 0;
b = 255;
break;
}
col++;
if (col == 3) col = 0;
}
x++;