I cannot seem to get the fade effect to work. The rainbow works fine, but the fade just snaps to the different colors. Can anyone tell me what's wrong? Here's what it output (please note that for power constraints I cannot take the colors higher than 50):
Here's the code for the effects portion:
uint8_t strip0_loop0_eff1() {
// Strip ID: 0 - Effect: Fade - LEDS: 32
// Steps: 100 - Delay: 10
// Colors: 2 (50.0.0, 0.50.0, )
// Options: duration=1000, every=1,
if(millis() - strip_0.effStart < 10 * (strip_0.effStep)) return 0x00;
uint8_t r,g,b;
double e;
e = (strip_0.effStep * 10) / 1000;
r = 0 * ( e ) + 50 * ( 1.0 - e );
g = 50 * ( e ) + 0 * ( 1.0 - e );
b = 0 * ( e ) + 0 * ( 1.0 - e );
for(uint16_t j=0;j<32;j++) {
if((j % 1) == 0)
strip_0.strip.setPixelColor(j, 50, 0, 0);
else
strip_0.strip.setPixelColor(j, 0, 0, 0);
}
if(strip_0.effStep >= 100) {strip_0.Reset(); return 0x03; }
else strip_0.effStep++;
return 0x01;
}
uint8_t strip0_loop0_eff2() {
// Strip ID: 0 - Effect: Fade - LEDS: 32
// Steps: 100 - Delay: 10
// Colors: 2 (0.50.0, 0.0.50, )
// Options: duration=1000, every=1,
if(millis() - strip_0.effStart < 10 * (strip_0.effStep)) return 0x00;
uint8_t r,g,b;
double e;
e = (strip_0.effStep * 10) / 1000;
r = 0 * ( e ) + 0 * ( 1.0 - e );
g = 0 * ( e ) + 50 * ( 1.0 - e );
b = 50 * ( e ) + 0 * ( 1.0 - e );
for(uint16_t j=0;j<32;j++) {
if((j % 1) == 0)
strip_0.strip.setPixelColor(j, 0, 50, 0);
else
strip_0.strip.setPixelColor(j, 0, 0, 0);
}
if(strip_0.effStep >= 100) {strip_0.Reset(); return 0x03; }
else strip_0.effStep++;
return 0x01;
}
uint8_t strip0_loop0_eff3() {
// Strip ID: 0 - Effect: Fade - LEDS: 32
// Steps: 100 - Delay: 10
// Colors: 2 (0.0.50, 25.25.0, )
// Options: duration=1000, every=1,
if(millis() - strip_0.effStart < 10 * (strip_0.effStep)) return 0x00;
uint8_t r,g,b;
double e;
e = (strip_0.effStep * 10) / 1000;
r = 25 * ( e ) + 0 * ( 1.0 - e );
g = 25 * ( e ) + 0 * ( 1.0 - e );
b = 0 * ( e ) + 50 * ( 1.0 - e );
for(uint16_t j=0;j<32;j++) {
if((j % 1) == 0)
strip_0.strip.setPixelColor(j, 0, 0, 50);
else
strip_0.strip.setPixelColor(j, 0, 0, 0);
}
if(strip_0.effStep >= 100) {strip_0.Reset(); return 0x03; }
else strip_0.effStep++;
return 0x01;
}
uint8_t strip0_loop0_eff4() {
// Strip ID: 0 - Effect: Fade - LEDS: 32
// Steps: 100 - Delay: 10
// Colors: 2 (25.25.0, 50.0.0, )
// Options: duration=1000, every=1,
if(millis() - strip_0.effStart < 10 * (strip_0.effStep)) return 0x00;
uint8_t r,g,b;
double e;
e = (strip_0.effStep * 10) / 1000;
r = 50 * ( e ) + 25 * ( 1.0 - e );
g = 0 * ( e ) + 25 * ( 1.0 - e );
b = 0 * ( e ) + 0 * ( 1.0 - e );
for(uint16_t j=0;j<32;j++) {
if((j % 1) == 0)
strip_0.strip.setPixelColor(j, 25, 25, 0);
else
strip_0.strip.setPixelColor(j, 0, 0, 0);
}
if(strip_0.effStep >= 100) {strip_0.Reset(); return 0x03; }
else strip_0.effStep++;
return 0x01;
}