commit
447f15cfa4
@ -2970,8 +2970,9 @@ uint16_t WS2812FX::mode_plasma(void) {
|
|||||||
for (int i = 0; i < SEGLEN; i++) { // For each of the LED's in the strand, set color & brightness based on a wave as follows:
|
for (int i = 0; i < SEGLEN; i++) { // For each of the LED's in the strand, set color & brightness based on a wave as follows:
|
||||||
uint8_t colorIndex = cubicwave8((i*(1+ 3*(SEGMENT.speed >> 5)))+(thisPhase) & 0xFF)/2 // factor=23 // Create a wave and add a phase change and add another wave with its own phase change.
|
uint8_t colorIndex = cubicwave8((i*(1+ 3*(SEGMENT.speed >> 5)))+(thisPhase) & 0xFF)/2 // factor=23 // Create a wave and add a phase change and add another wave with its own phase change.
|
||||||
+ cos8((i*(1+ 2*(SEGMENT.speed >> 5)))+(thatPhase) & 0xFF)/2; // factor=15 // Hey, you can even change the frequencies if you wish.
|
+ cos8((i*(1+ 2*(SEGMENT.speed >> 5)))+(thatPhase) & 0xFF)/2; // factor=15 // Hey, you can even change the frequencies if you wish.
|
||||||
uint8_t thisBright = qsub8(colorIndex, beatsin8(6,0,128));
|
uint8_t thisBright = qsub8(colorIndex, beatsin8(6,0, (255 - SEGMENT.intensity)|0x01 ));
|
||||||
setPixelColor(i, color_blend(SEGCOLOR(1), color_from_palette(colorIndex, false, false, 0), thisBright));
|
CRGB color = ColorFromPalette(currentPalette, colorIndex, thisBright, LINEARBLEND);
|
||||||
|
setPixelColor(i, color.red, color.green, color.blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FRAMETIME;
|
return FRAMETIME;
|
||||||
|
@ -248,7 +248,7 @@ public:
|
|||||||
if (color.R == 255 & color.G == 255 && color.B == 255 && color.W == 255) {
|
if (color.R == 255 & color.G == 255 && color.B == 255 && color.W == 255) {
|
||||||
SetRgbwPwm(0, 0, 0, 0, color.W * b / 255);
|
SetRgbwPwm(0, 0, 0, 0, color.W * b / 255);
|
||||||
} else if (color.R == 127 & color.G == 127 && color.B == 127 && color.W == 255) {
|
} else if (color.R == 127 & color.G == 127 && color.B == 127 && color.W == 255) {
|
||||||
SetRgbwPwm(0, 0, 0, color.W * b / 512, colorW.W * b / 255);
|
SetRgbwPwm(0, 0, 0, color.W * b / 512, color.W * b / 255);
|
||||||
} else if (color.R == 0 & color.G == 0 && color.B == 0 && color.W == 255) {
|
} else if (color.R == 0 & color.G == 0 && color.B == 0 && color.W == 255) {
|
||||||
SetRgbwPwm(0, 0, 0, color.W * b / 255, 0);
|
SetRgbwPwm(0, 0, 0, color.W * b / 255, 0);
|
||||||
} else if (color.R == 130 & color.G == 90 && color.B == 0 && color.W == 255) {
|
} else if (color.R == 130 & color.G == 90 && color.B == 0 && color.W == 255) {
|
||||||
@ -256,7 +256,7 @@ public:
|
|||||||
} else if (color.R == 255 & color.G == 153 && color.B == 0 && color.W == 255) {
|
} else if (color.R == 255 & color.G == 153 && color.B == 0 && color.W == 255) {
|
||||||
SetRgbwPwm(0, 0, 0, color.W * b / 255, 0);
|
SetRgbwPwm(0, 0, 0, color.W * b / 255, 0);
|
||||||
} else { // not only white colors
|
} else { // not only white colors
|
||||||
SetRgbwPwm(color.R * b / 255, colorW.G * b / 255, colorW.B * b / 255, color.W * b / 255);
|
SetRgbwPwm(color.R * b / 255, color.G * b / 255, color.B * b / 255, color.W * b / 255);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
SetRgbwPwm(color.R * b / 255, color.G * b / 255, color.B * b / 255, color.W * b / 255);
|
SetRgbwPwm(color.R * b / 255, color.G * b / 255, color.B * b / 255, color.W * b / 255);
|
||||||
|
@ -147,10 +147,10 @@ void decodeIR24OLD(uint32_t code)
|
|||||||
case IR24_OLD_MAGENTA : colorFromUint32(COLOR_MAGENTA); break;
|
case IR24_OLD_MAGENTA : colorFromUint32(COLOR_MAGENTA); break;
|
||||||
case IR24_OLD_PINK : colorFromUint32(COLOR_PINK); break;
|
case IR24_OLD_PINK : colorFromUint32(COLOR_PINK); break;
|
||||||
case IR24_OLD_WHITE : colorFromUint32(COLOR_WHITE); effectCurrent = 0; break;
|
case IR24_OLD_WHITE : colorFromUint32(COLOR_WHITE); effectCurrent = 0; break;
|
||||||
case IR24_OLD_FLASH : if (!applyPreset(1)) effectCurrent = FX_MODE_COLORTWINKLE; effectPalette = 0; break;
|
case IR24_OLD_FLASH : if (!applyPreset(1)) { effectCurrent = FX_MODE_COLORTWINKLE; effectPalette = 0; } break;
|
||||||
case IR24_OLD_STROBE : if (!applyPreset(2)) effectCurrent = FX_MODE_RAINBOW_CYCLE; effectPalette = 0; break;
|
case IR24_OLD_STROBE : if (!applyPreset(2)) { effectCurrent = FX_MODE_RAINBOW_CYCLE; effectPalette = 0; } break;
|
||||||
case IR24_OLD_FADE : if (!applyPreset(3)) effectCurrent = FX_MODE_BREATH; effectPalette = 0; break;
|
case IR24_OLD_FADE : if (!applyPreset(3)) { effectCurrent = FX_MODE_BREATH; effectPalette = 0; } break;
|
||||||
case IR24_OLD_SMOOTH : if (!applyPreset(4)) effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; break;
|
case IR24_OLD_SMOOTH : if (!applyPreset(4)) { effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; } break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
@ -180,13 +180,13 @@ void decodeIR24CT(uint32_t code)
|
|||||||
case IR24_CT_PURPLE : colorFromUint32(COLOR_PURPLE); break;
|
case IR24_CT_PURPLE : colorFromUint32(COLOR_PURPLE); break;
|
||||||
case IR24_CT_MAGENTA : colorFromUint32(COLOR_MAGENTA); break;
|
case IR24_CT_MAGENTA : colorFromUint32(COLOR_MAGENTA); break;
|
||||||
case IR24_CT_PINK : colorFromUint32(COLOR_PINK); break;
|
case IR24_CT_PINK : colorFromUint32(COLOR_PINK); break;
|
||||||
case IR24_CT_COLDWHITE : colorFromUint32(COLOR_COLDWHITE); effectCurrent = 0; break;
|
case IR24_CT_COLDWHITE : colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; break;
|
||||||
case IR24_CT_WARMWHITE : colorFromUint32(COLOR_WARMWHITE); effectCurrent = 0; break;
|
case IR24_CT_WARMWHITE : colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; break;
|
||||||
case IR24_CT_CTPLUS : colorFromUint32(COLOR_COLDWHITE2); effectCurrent = 0; break;
|
case IR24_CT_CTPLUS : colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; break;
|
||||||
case IR24_CT_CTMINUS : colorFromUint32(COLOR_WARMWHITE2); effectCurrent = 0; break;
|
case IR24_CT_CTMINUS : colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; break;
|
||||||
case IR24_CT_MEMORY : {
|
case IR24_CT_MEMORY : {
|
||||||
if (col[3] > 0) col[3] = 0;
|
if (col[3] > 0) col[3] = 0;
|
||||||
else colorFromUint32(COLOR_NEUTRALWHITE); effectCurrent = 0; } break;
|
else colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; } break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
@ -243,10 +243,10 @@ void decodeIR40(uint32_t code)
|
|||||||
case IR40_SLOW : relativeChange(&effectSpeed, -10, 5); break;
|
case IR40_SLOW : relativeChange(&effectSpeed, -10, 5); break;
|
||||||
case IR40_JUMP7 : relativeChange(&effectIntensity, 10); break;
|
case IR40_JUMP7 : relativeChange(&effectIntensity, 10); break;
|
||||||
case IR40_AUTO : relativeChange(&effectIntensity, -10, 5); break;
|
case IR40_AUTO : relativeChange(&effectIntensity, -10, 5); break;
|
||||||
case IR40_JUMP3 : if (!applyPreset(1)) effectCurrent = FX_MODE_STATIC; effectPalette = 0; break;
|
case IR40_JUMP3 : if (!applyPreset(1)) { effectCurrent = FX_MODE_STATIC; effectPalette = 0; } break;
|
||||||
case IR40_FADE3 : if (!applyPreset(2)) effectCurrent = FX_MODE_BREATH; effectPalette = 0; break;
|
case IR40_FADE3 : if (!applyPreset(2)) { effectCurrent = FX_MODE_BREATH; effectPalette = 0; } break;
|
||||||
case IR40_FADE7 : if (!applyPreset(3)) effectCurrent = FX_MODE_FIRE_FLICKER; effectPalette = 0; break;
|
case IR40_FADE7 : if (!applyPreset(3)) { effectCurrent = FX_MODE_FIRE_FLICKER; effectPalette = 0; } break;
|
||||||
case IR40_FLASH : if (!applyPreset(4)) effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; break;
|
case IR40_FLASH : if (!applyPreset(4)) { effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; } break;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
colorUpdated(2); //for notifier, IR is considered a button input
|
colorUpdated(2); //for notifier, IR is considered a button input
|
||||||
@ -299,12 +299,12 @@ void decodeIR44(uint32_t code)
|
|||||||
case IR44_BLUEMINUS : relativeChange(&effectIntensity, -10, 5); break;
|
case IR44_BLUEMINUS : relativeChange(&effectIntensity, -10, 5); break;
|
||||||
case IR44_QUICK : relativeChange(&effectSpeed, 10); break;
|
case IR44_QUICK : relativeChange(&effectSpeed, 10); break;
|
||||||
case IR44_SLOW : relativeChange(&effectSpeed, -10, 5); break;
|
case IR44_SLOW : relativeChange(&effectSpeed, -10, 5); break;
|
||||||
case IR44_DIY1 : if (!applyPreset(1)) effectCurrent = FX_MODE_STATIC; effectPalette = 0; break;
|
case IR44_DIY1 : if (!applyPreset(1)) { effectCurrent = FX_MODE_STATIC; effectPalette = 0; } break;
|
||||||
case IR44_DIY2 : if (!applyPreset(2)) effectCurrent = FX_MODE_BREATH; effectPalette = 0; break;
|
case IR44_DIY2 : if (!applyPreset(2)) { effectCurrent = FX_MODE_BREATH; effectPalette = 0; } break;
|
||||||
case IR44_DIY3 : if (!applyPreset(3)) effectCurrent = FX_MODE_FIRE_FLICKER; effectPalette = 0; break;
|
case IR44_DIY3 : if (!applyPreset(3)) { effectCurrent = FX_MODE_FIRE_FLICKER; effectPalette = 0; } break;
|
||||||
case IR44_DIY4 : if (!applyPreset(4)) effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; break;
|
case IR44_DIY4 : if (!applyPreset(4)) { effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; } break;
|
||||||
case IR44_DIY5 : if (!applyPreset(5)) effectCurrent = FX_MODE_METEOR_SMOOTH; effectPalette = 0; break;
|
case IR44_DIY5 : if (!applyPreset(5)) { effectCurrent = FX_MODE_METEOR_SMOOTH; effectPalette = 0; } break;
|
||||||
case IR44_DIY6 : if (!applyPreset(6)) effectCurrent = FX_MODE_RAIN; effectPalette = 0; break;
|
case IR44_DIY6 : if (!applyPreset(6)) { effectCurrent = FX_MODE_RAIN; effectPalette = 0; } break;
|
||||||
case IR44_AUTO : effectCurrent = FX_MODE_STATIC; break;
|
case IR44_AUTO : effectCurrent = FX_MODE_STATIC; break;
|
||||||
case IR44_FLASH : effectCurrent = FX_MODE_PALETTE; break;
|
case IR44_FLASH : effectCurrent = FX_MODE_PALETTE; break;
|
||||||
case IR44_JUMP3 : bri = 63; break;
|
case IR44_JUMP3 : bri = 63; break;
|
||||||
@ -336,10 +336,10 @@ void decodeIR21(uint32_t code)
|
|||||||
case IR21_PURPLE: colorFromUint32(COLOR_PURPLE); break;
|
case IR21_PURPLE: colorFromUint32(COLOR_PURPLE); break;
|
||||||
case IR21_PINK: colorFromUint32(COLOR_PINK); break;
|
case IR21_PINK: colorFromUint32(COLOR_PINK); break;
|
||||||
case IR21_WHITE: colorFromUint32(COLOR_WHITE); effectCurrent = 0; break;
|
case IR21_WHITE: colorFromUint32(COLOR_WHITE); effectCurrent = 0; break;
|
||||||
case IR21_FLASH: if (!applyPreset(1)) effectCurrent = FX_MODE_COLORTWINKLE; break;
|
case IR21_FLASH: if (!applyPreset(1)) { effectCurrent = FX_MODE_COLORTWINKLE; effectPalette = 0; } break;
|
||||||
case IR21_STROBE: if (!applyPreset(2)) effectCurrent = FX_MODE_RAINBOW_CYCLE; break;
|
case IR21_STROBE: if (!applyPreset(2)) { effectCurrent = FX_MODE_RAINBOW_CYCLE; effectPalette = 0; } break;
|
||||||
case IR21_FADE: if (!applyPreset(3)) effectCurrent = FX_MODE_BREATH; break;
|
case IR21_FADE: if (!applyPreset(3)) { effectCurrent = FX_MODE_BREATH; effectPalette = 0; } break;
|
||||||
case IR21_SMOOTH: if (!applyPreset(4)) effectCurrent = FX_MODE_RAINBOW; break;
|
case IR21_SMOOTH: if (!applyPreset(4)) { effectCurrent = FX_MODE_RAINBOW; effectPalette = 0; } break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
|
Loading…
Reference in New Issue
Block a user