Hello,
I want to code an very slow fade animation with and without noise.
I have these functions:
void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
for( int led = 0; led < NUM_LEDS; led++) {
leds[led] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
colorIndex += 3;
}
}
and
void fillnoise8_2() {
for(int i = 0; i < NUM_LEDS; i++) {
int ioffset = scale * i;
uint8_t data = inoise8(x + ioffset,z);
data = qsub8(data,16);
data = qadd8(data,scale8(data,39));
uint8_t olddata = noise[i];
uint8_t newdata = scale8( olddata, speed) + scale8( data, 256 - speed);
data = newdata;
noise[i] = data;
}
z += speed ;
x += speed / 4;
}
void mapNoiseToLEDsUsingPalette()
{
uint8_t index;
for(int i = 0; i < NUM_LEDS; i++) {
index = noise[i];
CRGB color = ColorFromPalette( currentPalette, index, brightness, currentBlending );
leds[i] = color;
}
index += 1;
}
The settings are:
currentPalette = OceanColors_p;
currentBlending = LINEARBLEND;
speed = 3;
scale = 20;
With set the speed to 1 its even to fast fade.
I play in the loop function with something like this:
EVERY_N_MILLISECONDS(10){
fillnoise8_2();
mapNoiseToLEDsUsingPalette();
}
but this makes the fade like steps.
How can I make the fade very slow?