IR button & W color fix.
This commit is contained in:
parent
2da14e5b2a
commit
6c943a7158
@ -11,6 +11,7 @@ void colorFromUint32(uint32_t in, bool secondary)
|
|||||||
_col[1] = G(in);
|
_col[1] = G(in);
|
||||||
_col[2] = B(in);
|
_col[2] = B(in);
|
||||||
_col[3] = W(in);
|
_col[3] = W(in);
|
||||||
|
colorChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//load a color without affecting the white channel
|
//load a color without affecting the white channel
|
||||||
@ -20,6 +21,7 @@ void colorFromUint24(uint32_t in, bool secondary)
|
|||||||
_col[0] = R(in);
|
_col[0] = R(in);
|
||||||
_col[1] = G(in);
|
_col[1] = G(in);
|
||||||
_col[2] = B(in);
|
_col[2] = B(in);
|
||||||
|
colorChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//relatively change white brightness, minumum A=5
|
//relatively change white brightness, minumum A=5
|
||||||
@ -29,6 +31,7 @@ void relativeChangeWhite(int8_t amount, byte lowerBoundary)
|
|||||||
if (new_val > 0xFF) new_val = 0xFF;
|
if (new_val > 0xFF) new_val = 0xFF;
|
||||||
else if (new_val < lowerBoundary) new_val = lowerBoundary;
|
else if (new_val < lowerBoundary) new_val = lowerBoundary;
|
||||||
col[3] = new_val;
|
col[3] = new_val;
|
||||||
|
colorChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb
|
void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb
|
||||||
|
232
wled00/ir.cpp
232
wled00/ir.cpp
@ -77,39 +77,41 @@ void presetFallback(uint8_t presetID, uint8_t effectID, uint8_t paletteID)
|
|||||||
effectPalette = paletteID;
|
effectPalette = paletteID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* This is no longer needed due to JSON IR mod
|
|
||||||
*
|
|
||||||
//Add what your custom IR codes should trigger here. Guide: https://github.com/Aircoookie/WLED/wiki/Infrared-Control
|
|
||||||
//IR codes themselves can be defined directly after "case" or in "ir_codes.h"
|
|
||||||
bool decodeIRCustom(uint32_t code)
|
|
||||||
{
|
|
||||||
switch (code)
|
|
||||||
{
|
|
||||||
//just examples, feel free to modify or remove
|
|
||||||
case IRCUSTOM_ONOFF : toggleOnOff(); break;
|
|
||||||
case IRCUSTOM_MACRO1 : applyPreset(1, CALL_MODE_BUTTON_PRESET); break;
|
|
||||||
|
|
||||||
default: return false;
|
|
||||||
}
|
|
||||||
if (code != IRCUSTOM_MACRO1) colorUpdated(CALL_MODE_BUTTON); //don't update color again if we apply macro, it already does it
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void relativeChange(byte* property, int8_t amount, byte lowerBoundary, byte higherBoundary)
|
void relativeChange(byte* property, int8_t amount, byte lowerBoundary, byte higherBoundary)
|
||||||
{
|
{
|
||||||
int16_t new_val = (int16_t) *property + amount;
|
int16_t new_val = (int16_t) *property + amount;
|
||||||
if (new_val > higherBoundary) new_val = higherBoundary;
|
if (new_val > higherBoundary) new_val = higherBoundary;
|
||||||
else if (new_val < lowerBoundary) new_val = lowerBoundary;
|
else if (new_val < lowerBoundary) new_val = lowerBoundary;
|
||||||
*property = (byte)constrain(new_val,0.1,255.1);
|
*property = (byte)constrain(new_val, 0, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeEffect(uint8_t fx)
|
||||||
|
{
|
||||||
|
//byte selectedSeg = strip.getMainSegmentId();
|
||||||
|
//WS2812FX::Segment& selseg = strip.getSegment(selectedSeg);
|
||||||
|
strip.setMode(strip.getMainSegmentId(), fx);
|
||||||
|
effectCurrent = fx;
|
||||||
|
effectChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void changePalette(uint8_t pal)
|
||||||
|
{
|
||||||
|
byte selectedSeg = strip.getMainSegmentId();
|
||||||
|
WS2812FX::Segment& selseg = strip.getSegment(selectedSeg);
|
||||||
|
selseg.palette = pal;
|
||||||
|
effectPalette = pal;
|
||||||
|
effectChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeEffectSpeed(int8_t amount)
|
void changeEffectSpeed(int8_t amount)
|
||||||
{
|
{
|
||||||
|
byte selectedSeg = strip.getMainSegmentId();
|
||||||
|
WS2812FX::Segment& selseg = strip.getSegment(selectedSeg);
|
||||||
if (effectCurrent != 0) {
|
if (effectCurrent != 0) {
|
||||||
int16_t new_val = (int16_t) effectSpeed + amount;
|
int16_t new_val = (int16_t) effectSpeed + amount;
|
||||||
effectSpeed = (byte)constrain(new_val,0.1,255.1);
|
effectSpeed = (byte)constrain(new_val,0,255);
|
||||||
|
selseg.speed = effectSpeed;
|
||||||
|
effectChanged = true;
|
||||||
} else { // if Effect == "solid Color", change the hue of the primary color
|
} else { // if Effect == "solid Color", change the hue of the primary color
|
||||||
CRGB fastled_col;
|
CRGB fastled_col;
|
||||||
fastled_col.red = col[0];
|
fastled_col.red = col[0];
|
||||||
@ -124,6 +126,7 @@ void changeEffectSpeed(int8_t amount)
|
|||||||
col[0] = fastled_col.red;
|
col[0] = fastled_col.red;
|
||||||
col[1] = fastled_col.green;
|
col[1] = fastled_col.green;
|
||||||
col[2] = fastled_col.blue;
|
col[2] = fastled_col.blue;
|
||||||
|
colorChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(amount > 0) lastRepeatableAction = ACTION_SPEED_UP;
|
if(amount > 0) lastRepeatableAction = ACTION_SPEED_UP;
|
||||||
@ -133,9 +136,13 @@ void changeEffectSpeed(int8_t amount)
|
|||||||
|
|
||||||
void changeEffectIntensity(int8_t amount)
|
void changeEffectIntensity(int8_t amount)
|
||||||
{
|
{
|
||||||
|
byte selectedSeg = strip.getMainSegmentId();
|
||||||
|
WS2812FX::Segment& selseg = strip.getSegment(selectedSeg);
|
||||||
if (effectCurrent != 0) {
|
if (effectCurrent != 0) {
|
||||||
int16_t new_val = (int16_t) effectIntensity + amount;
|
int16_t new_val = (int16_t) effectIntensity + amount;
|
||||||
effectIntensity = (byte)constrain(new_val,0.1,255.1);
|
effectIntensity = (byte)constrain(new_val,0,255);
|
||||||
|
selseg.intensity = effectIntensity;
|
||||||
|
effectChanged = true;
|
||||||
} else { // if Effect == "solid Color", change the saturation of the primary color
|
} else { // if Effect == "solid Color", change the saturation of the primary color
|
||||||
CRGB fastled_col;
|
CRGB fastled_col;
|
||||||
fastled_col.red = col[0];
|
fastled_col.red = col[0];
|
||||||
@ -143,11 +150,12 @@ void changeEffectIntensity(int8_t amount)
|
|||||||
fastled_col.blue = col[2];
|
fastled_col.blue = col[2];
|
||||||
CHSV prim_hsv = rgb2hsv_approximate(fastled_col);
|
CHSV prim_hsv = rgb2hsv_approximate(fastled_col);
|
||||||
int16_t new_val = (int16_t) prim_hsv.s + amount;
|
int16_t new_val = (int16_t) prim_hsv.s + amount;
|
||||||
prim_hsv.s = (byte)constrain(new_val,0.1,255.1); // constrain to 0-255
|
prim_hsv.s = (byte)constrain(new_val,0,255); // constrain to 0-255
|
||||||
hsv2rgb_rainbow(prim_hsv, fastled_col);
|
hsv2rgb_rainbow(prim_hsv, fastled_col);
|
||||||
col[0] = fastled_col.red;
|
col[0] = fastled_col.red;
|
||||||
col[1] = fastled_col.green;
|
col[1] = fastled_col.green;
|
||||||
col[2] = fastled_col.blue;
|
col[2] = fastled_col.blue;
|
||||||
|
colorChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(amount > 0) lastRepeatableAction = ACTION_INTENSITY_UP;
|
if(amount > 0) lastRepeatableAction = ACTION_INTENSITY_UP;
|
||||||
@ -266,11 +274,11 @@ void decodeIR24(uint32_t code)
|
|||||||
case IR24_PURPLE : colorFromUint32(COLOR_PURPLE); break;
|
case IR24_PURPLE : colorFromUint32(COLOR_PURPLE); break;
|
||||||
case IR24_MAGENTA : colorFromUint32(COLOR_MAGENTA); break;
|
case IR24_MAGENTA : colorFromUint32(COLOR_MAGENTA); break;
|
||||||
case IR24_PINK : colorFromUint32(COLOR_PINK); break;
|
case IR24_PINK : colorFromUint32(COLOR_PINK); break;
|
||||||
case IR24_WHITE : colorFromUint32(COLOR_WHITE); effectCurrent = 0; break;
|
case IR24_WHITE : colorFromUint32(COLOR_WHITE); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR24_FLASH : presetFallback(1, FX_MODE_COLORTWINKLE, effectPalette); break;
|
case IR24_FLASH : presetFallback(1, FX_MODE_COLORTWINKLE, effectPalette); break;
|
||||||
case IR24_STROBE : presetFallback(2, FX_MODE_RAINBOW_CYCLE, effectPalette); break;
|
case IR24_STROBE : presetFallback(2, FX_MODE_RAINBOW_CYCLE, effectPalette); break;
|
||||||
case IR24_FADE : presetFallback(3, FX_MODE_BREATH, effectPalette); break;
|
case IR24_FADE : presetFallback(3, FX_MODE_BREATH, effectPalette); break;
|
||||||
case IR24_SMOOTH : presetFallback(4, FX_MODE_RAINBOW, effectPalette); break;
|
case IR24_SMOOTH : presetFallback(4, FX_MODE_RAINBOW, effectPalette); break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
@ -298,7 +306,7 @@ void decodeIR24OLD(uint32_t code)
|
|||||||
case IR24_OLD_PURPLE : colorFromUint32(COLOR_PURPLE); break;
|
case IR24_OLD_PURPLE : colorFromUint32(COLOR_PURPLE); break;
|
||||||
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); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR24_OLD_FLASH : presetFallback(1, FX_MODE_COLORTWINKLE, 0); break;
|
case IR24_OLD_FLASH : presetFallback(1, FX_MODE_COLORTWINKLE, 0); break;
|
||||||
case IR24_OLD_STROBE : presetFallback(2, FX_MODE_RAINBOW_CYCLE, 0); break;
|
case IR24_OLD_STROBE : presetFallback(2, FX_MODE_RAINBOW_CYCLE, 0); break;
|
||||||
case IR24_OLD_FADE : presetFallback(3, FX_MODE_BREATH, 0); break;
|
case IR24_OLD_FADE : presetFallback(3, FX_MODE_BREATH, 0); break;
|
||||||
@ -330,13 +338,11 @@ 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(COLOR2_COLDWHITE); effectCurrent = 0; break;
|
case IR24_CT_COLDWHITE : colorFromUint32(COLOR2_COLDWHITE); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR24_CT_WARMWHITE : colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; break;
|
case IR24_CT_WARMWHITE : colorFromUint32(COLOR2_WARMWHITE); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR24_CT_CTPLUS : colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; break;
|
case IR24_CT_CTPLUS : colorFromUint32(COLOR2_COLDWHITE2); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR24_CT_CTMINUS : colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; break;
|
case IR24_CT_CTMINUS : colorFromUint32(COLOR2_WARMWHITE2); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR24_CT_MEMORY : {
|
case IR24_CT_MEMORY : colorFromUint32(COLOR2_NEUTRALWHITE); changeEffect(FX_MODE_STATIC); break;
|
||||||
if (col[3] > 0) col[3] = 0;
|
|
||||||
else colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; } break;
|
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
@ -364,21 +370,31 @@ void decodeIR40(uint32_t code)
|
|||||||
case IR40_PURPLE : colorFromUint24(COLOR_PURPLE); break;
|
case IR40_PURPLE : colorFromUint24(COLOR_PURPLE); break;
|
||||||
case IR40_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
case IR40_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
||||||
case IR40_PINK : colorFromUint24(COLOR_PINK); break;
|
case IR40_PINK : colorFromUint24(COLOR_PINK); break;
|
||||||
case IR40_WARMWHITE2 : {
|
case IR40_WARMWHITE2 :
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_WARMWHITE2);
|
||||||
else colorFromUint24(COLOR_WARMWHITE2); } break;
|
else colorFromUint24(COLOR_WARMWHITE2);
|
||||||
case IR40_WARMWHITE : {
|
changeEffect(FX_MODE_STATIC);
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; }
|
break;
|
||||||
else colorFromUint24(COLOR_WARMWHITE); } break;
|
case IR40_WARMWHITE :
|
||||||
case IR40_WHITE : {
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_WARMWHITE);
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; }
|
else colorFromUint24(COLOR_WARMWHITE);
|
||||||
else colorFromUint24(COLOR_NEUTRALWHITE); } break;
|
changeEffect(FX_MODE_STATIC);
|
||||||
case IR40_COLDWHITE : {
|
break;
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; }
|
case IR40_WHITE :
|
||||||
else colorFromUint24(COLOR_COLDWHITE); } break;
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_NEUTRALWHITE);
|
||||||
case IR40_COLDWHITE2 : {
|
else colorFromUint24(COLOR_NEUTRALWHITE);
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; }
|
changeEffect(FX_MODE_STATIC);
|
||||||
else colorFromUint24(COLOR_COLDWHITE2); } break;
|
break;
|
||||||
|
case IR40_COLDWHITE :
|
||||||
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_COLDWHITE);
|
||||||
|
else colorFromUint24(COLOR_COLDWHITE);
|
||||||
|
changeEffect(FX_MODE_STATIC);
|
||||||
|
break;
|
||||||
|
case IR40_COLDWHITE2 :
|
||||||
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_COLDWHITE2);
|
||||||
|
else colorFromUint24(COLOR_COLDWHITE2);
|
||||||
|
changeEffect(FX_MODE_STATIC);
|
||||||
|
break;
|
||||||
case IR40_WPLUS : relativeChangeWhite(10); break;
|
case IR40_WPLUS : relativeChangeWhite(10); break;
|
||||||
case IR40_WMINUS : relativeChangeWhite(-10, 5); break;
|
case IR40_WMINUS : relativeChangeWhite(-10, 5); break;
|
||||||
case IR40_WOFF : whiteLast = col[3]; col[3] = 0; break;
|
case IR40_WOFF : whiteLast = col[3]; col[3] = 0; break;
|
||||||
@ -421,43 +437,63 @@ void decodeIR44(uint32_t code)
|
|||||||
case IR44_PURPLE : colorFromUint24(COLOR_PURPLE); break;
|
case IR44_PURPLE : colorFromUint24(COLOR_PURPLE); break;
|
||||||
case IR44_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
case IR44_MAGENTA : colorFromUint24(COLOR_MAGENTA); break;
|
||||||
case IR44_PINK : colorFromUint24(COLOR_PINK); break;
|
case IR44_PINK : colorFromUint24(COLOR_PINK); break;
|
||||||
case IR44_WHITE : {
|
case IR44_WHITE :
|
||||||
if (strip.hasWhiteChannel()) {
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_NEUTRALWHITE);
|
||||||
if (col[3] > 0) col[3] = 0;
|
else colorFromUint24(COLOR_NEUTRALWHITE);
|
||||||
else { colorFromUint32(COLOR2_NEUTRALWHITE); effectCurrent = 0; }
|
changeEffect(FX_MODE_STATIC);
|
||||||
} else colorFromUint24(COLOR_NEUTRALWHITE); } break;
|
break;
|
||||||
case IR44_WARMWHITE2 : {
|
case IR44_WARMWHITE2 :
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE2); effectCurrent = 0; }
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_WARMWHITE2);
|
||||||
else colorFromUint24(COLOR_WARMWHITE2); } break;
|
else colorFromUint24(COLOR_WARMWHITE2);
|
||||||
case IR44_WARMWHITE : {
|
changeEffect(FX_MODE_STATIC);
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_WARMWHITE); effectCurrent = 0; }
|
break;
|
||||||
else colorFromUint24(COLOR_WARMWHITE); } break;
|
case IR44_WARMWHITE :
|
||||||
case IR44_COLDWHITE : {
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_WARMWHITE);
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE); effectCurrent = 0; }
|
else colorFromUint24(COLOR_WARMWHITE);
|
||||||
else colorFromUint24(COLOR_COLDWHITE); } break;
|
changeEffect(FX_MODE_STATIC);
|
||||||
case IR44_COLDWHITE2 : {
|
break;
|
||||||
if (strip.hasWhiteChannel()) {colorFromUint32(COLOR2_COLDWHITE2); effectCurrent = 0; }
|
case IR44_COLDWHITE :
|
||||||
else colorFromUint24(COLOR_COLDWHITE2); } break;
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_COLDWHITE);
|
||||||
case IR44_REDPLUS : relativeChange(&effectCurrent, 1, 0, MODE_COUNT); break;
|
else colorFromUint24(COLOR_COLDWHITE);
|
||||||
case IR44_REDMINUS : relativeChange(&effectCurrent, -1, 0); break;
|
changeEffect(FX_MODE_STATIC);
|
||||||
case IR44_GREENPLUS : relativeChange(&effectPalette, 1, 0, strip.getPaletteCount() -1); break;
|
break;
|
||||||
case IR44_GREENMINUS : relativeChange(&effectPalette, -1, 0); break;
|
case IR44_COLDWHITE2 :
|
||||||
case IR44_BLUEPLUS : changeEffectIntensity( 16); break;
|
if (strip.hasWhiteChannel()) colorFromUint32(COLOR2_COLDWHITE2);
|
||||||
case IR44_BLUEMINUS : changeEffectIntensity(-16); break;
|
else colorFromUint24(COLOR_COLDWHITE2);
|
||||||
case IR44_QUICK : changeEffectSpeed( 16); break;
|
changeEffect(FX_MODE_STATIC);
|
||||||
case IR44_SLOW : changeEffectSpeed(-16); break;
|
break;
|
||||||
|
case IR44_REDPLUS :
|
||||||
|
relativeChange(&effectCurrent, 1, 0, MODE_COUNT);
|
||||||
|
changeEffect(effectCurrent);
|
||||||
|
break;
|
||||||
|
case IR44_REDMINUS :
|
||||||
|
relativeChange(&effectCurrent, -1, 0);
|
||||||
|
changeEffect(effectCurrent);
|
||||||
|
break;
|
||||||
|
case IR44_GREENPLUS :
|
||||||
|
relativeChange(&effectPalette, 1, 0, strip.getPaletteCount() -1);
|
||||||
|
changePalette(effectPalette);
|
||||||
|
break;
|
||||||
|
case IR44_GREENMINUS :
|
||||||
|
relativeChange(&effectPalette, -1, 0);
|
||||||
|
changePalette(effectPalette);
|
||||||
|
break;
|
||||||
|
case IR44_BLUEPLUS : changeEffectIntensity( 16); break;
|
||||||
|
case IR44_BLUEMINUS : changeEffectIntensity(-16); break;
|
||||||
|
case IR44_QUICK : changeEffectSpeed( 16); break;
|
||||||
|
case IR44_SLOW : changeEffectSpeed(-16); break;
|
||||||
case IR44_DIY1 : presetFallback(1, FX_MODE_STATIC, 0); break;
|
case IR44_DIY1 : presetFallback(1, FX_MODE_STATIC, 0); break;
|
||||||
case IR44_DIY2 : presetFallback(2, FX_MODE_BREATH, 0); break;
|
case IR44_DIY2 : presetFallback(2, FX_MODE_BREATH, 0); break;
|
||||||
case IR44_DIY3 : presetFallback(3, FX_MODE_FIRE_FLICKER, 0); break;
|
case IR44_DIY3 : presetFallback(3, FX_MODE_FIRE_FLICKER, 0); break;
|
||||||
case IR44_DIY4 : presetFallback(4, FX_MODE_RAINBOW, 0); break;
|
case IR44_DIY4 : presetFallback(4, FX_MODE_RAINBOW, 0); break;
|
||||||
case IR44_DIY5 : presetFallback(5, FX_MODE_METEOR_SMOOTH, 0); break;
|
case IR44_DIY5 : presetFallback(5, FX_MODE_METEOR_SMOOTH, 0); break;
|
||||||
case IR44_DIY6 : presetFallback(6, FX_MODE_RAIN, 0); break;
|
case IR44_DIY6 : presetFallback(6, FX_MODE_RAIN, 0); break;
|
||||||
case IR44_AUTO : effectCurrent = FX_MODE_STATIC; break;
|
case IR44_AUTO : changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR44_FLASH : effectCurrent = FX_MODE_PALETTE; break;
|
case IR44_FLASH : changeEffect(FX_MODE_PALETTE); break;
|
||||||
case IR44_JUMP3 : bri = 63; break;
|
case IR44_JUMP3 : bri = 63; break;
|
||||||
case IR44_JUMP7 : bri = 127; break;
|
case IR44_JUMP7 : bri = 127; break;
|
||||||
case IR44_FADE3 : bri = 191; break;
|
case IR44_FADE3 : bri = 191; break;
|
||||||
case IR44_FADE7 : bri = 255; break;
|
case IR44_FADE7 : bri = 255; break;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
}
|
}
|
||||||
@ -481,7 +517,7 @@ void decodeIR21(uint32_t code)
|
|||||||
case IR21_DEEPBLUE: colorFromUint32(COLOR_DEEPBLUE); break;
|
case IR21_DEEPBLUE: colorFromUint32(COLOR_DEEPBLUE); break;
|
||||||
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); changeEffect(FX_MODE_STATIC); break;
|
||||||
case IR21_FLASH: presetFallback(1, FX_MODE_COLORTWINKLE, 0); break;
|
case IR21_FLASH: presetFallback(1, FX_MODE_COLORTWINKLE, 0); break;
|
||||||
case IR21_STROBE: presetFallback(2, FX_MODE_RAINBOW_CYCLE, 0); break;
|
case IR21_STROBE: presetFallback(2, FX_MODE_RAINBOW_CYCLE, 0); break;
|
||||||
case IR21_FADE: presetFallback(3, FX_MODE_BREATH, 0); break;
|
case IR21_FADE: presetFallback(3, FX_MODE_BREATH, 0); break;
|
||||||
@ -497,9 +533,13 @@ void decodeIR6(uint32_t code)
|
|||||||
case IR6_POWER: toggleOnOff(); break;
|
case IR6_POWER: toggleOnOff(); break;
|
||||||
case IR6_CHANNEL_UP: incBrightness(); break;
|
case IR6_CHANNEL_UP: incBrightness(); break;
|
||||||
case IR6_CHANNEL_DOWN: decBrightness(); break;
|
case IR6_CHANNEL_DOWN: decBrightness(); break;
|
||||||
case IR6_VOLUME_UP: relativeChange(&effectCurrent, 1, 0, MODE_COUNT); break; // next effect
|
case IR6_VOLUME_UP:
|
||||||
|
relativeChange(&effectCurrent, 1, 0, MODE_COUNT); // next effect
|
||||||
|
changeEffect(effectCurrent);
|
||||||
|
break;
|
||||||
case IR6_VOLUME_DOWN: // next palette
|
case IR6_VOLUME_DOWN: // next palette
|
||||||
relativeChange(&effectPalette, 1, 0, strip.getPaletteCount() -1);
|
relativeChange(&effectPalette, 1, 0, strip.getPaletteCount() -1);
|
||||||
|
changePalette(effectPalette);
|
||||||
switch(lastIR6ColourIdx) {
|
switch(lastIR6ColourIdx) {
|
||||||
case 0: colorFromUint32(COLOR_RED); break;
|
case 0: colorFromUint32(COLOR_RED); break;
|
||||||
case 1: colorFromUint32(COLOR_REDDISH); break;
|
case 1: colorFromUint32(COLOR_REDDISH); break;
|
||||||
@ -517,8 +557,14 @@ void decodeIR6(uint32_t code)
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
lastIR6ColourIdx++;
|
lastIR6ColourIdx++;
|
||||||
if(lastIR6ColourIdx > 12) lastIR6ColourIdx = 0; break;
|
if(lastIR6ColourIdx > 12) lastIR6ColourIdx = 0;
|
||||||
case IR6_MUTE: effectCurrent = 0; effectPalette = 0; colorFromUint32(COLOR_WHITE); bri=255; break;
|
break;
|
||||||
|
case IR6_MUTE:
|
||||||
|
changeEffect(FX_MODE_STATIC);
|
||||||
|
changePalette(0);
|
||||||
|
colorFromUint32(COLOR_WHITE);
|
||||||
|
bri=255;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
}
|
}
|
||||||
@ -530,13 +576,13 @@ void decodeIR9(uint32_t code)
|
|||||||
case IR9_A : presetFallback(1, FX_MODE_COLORTWINKLE, effectPalette); break;
|
case IR9_A : presetFallback(1, FX_MODE_COLORTWINKLE, effectPalette); break;
|
||||||
case IR9_B : presetFallback(2, FX_MODE_RAINBOW_CYCLE, effectPalette); break;
|
case IR9_B : presetFallback(2, FX_MODE_RAINBOW_CYCLE, effectPalette); break;
|
||||||
case IR9_C : presetFallback(3, FX_MODE_BREATH, effectPalette); break;
|
case IR9_C : presetFallback(3, FX_MODE_BREATH, effectPalette); break;
|
||||||
case IR9_UP : incBrightness(); break;
|
case IR9_UP : incBrightness(); break;
|
||||||
case IR9_DOWN : decBrightness(); break;
|
case IR9_DOWN : decBrightness(); break;
|
||||||
//case IR9_UP : changeEffectIntensity(16); break;
|
//case IR9_UP : changeEffectIntensity(16); break;
|
||||||
//case IR9_DOWN : changeEffectIntensity(-16); break;
|
//case IR9_DOWN : changeEffectIntensity(-16); break;
|
||||||
case IR9_LEFT : changeEffectSpeed(-16); break;
|
case IR9_LEFT : changeEffectSpeed(-16); break;
|
||||||
case IR9_RIGHT : changeEffectSpeed(16); break;
|
case IR9_RIGHT : changeEffectSpeed(16); break;
|
||||||
case IR9_SELECT : relativeChange(&effectCurrent, 1, 0, MODE_COUNT); break;
|
case IR9_SELECT : relativeChange(&effectCurrent, 1, 0, MODE_COUNT); changeEffect(effectCurrent); break;
|
||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
lastValidCode = code;
|
lastValidCode = code;
|
||||||
@ -629,7 +675,7 @@ void decodeIRJson(uint32_t code)
|
|||||||
}
|
}
|
||||||
handleSet(nullptr, cmdStr, false);
|
handleSet(nullptr, cmdStr, false);
|
||||||
}
|
}
|
||||||
colorUpdated(CALL_MODE_BUTTON);
|
//colorUpdated(CALL_MODE_BUTTON);
|
||||||
} else if (!jsonCmdObj.isNull()) {
|
} else if (!jsonCmdObj.isNull()) {
|
||||||
// command is JSON object
|
// command is JSON object
|
||||||
deserializeState(jsonCmdObj, CALL_MODE_BUTTON_PRESET);
|
deserializeState(jsonCmdObj, CALL_MODE_BUTTON_PRESET);
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
//Infrared codes for 24-key remote from http://woodsgood.ca/projects/2015/02/13/rgb-led-strip-controllers-ir-codes/
|
//Infrared codes for 24-key remote from http://woodsgood.ca/projects/2015/02/13/rgb-led-strip-controllers-ir-codes/
|
||||||
#define IR24_BRIGHTER 0xF700FF
|
#define IR24_BRIGHTER 0xF700FF
|
||||||
#define IR24_DARKER 0xF7807F
|
#define IR24_DARKER 0xF7807F
|
||||||
#define IR24_OFF 0xF740BF
|
#define IR24_OFF 0xF740BF
|
||||||
#define IR24_ON 0xF7C03F
|
#define IR24_ON 0xF7C03F
|
||||||
#define IR24_RED 0xF720DF
|
#define IR24_RED 0xF720DF
|
||||||
#define IR24_REDDISH 0xF710EF
|
#define IR24_REDDISH 0xF710EF
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#define IR24_YELLOW 0xF728D7
|
#define IR24_YELLOW 0xF728D7
|
||||||
#define IR24_GREEN 0xF7A05F
|
#define IR24_GREEN 0xF7A05F
|
||||||
#define IR24_GREENISH 0xF7906F
|
#define IR24_GREENISH 0xF7906F
|
||||||
#define IR24_TURQUOISE 0xF7B04F
|
#define IR24_TURQUOISE 0xF7B04F
|
||||||
#define IR24_CYAN 0xF78877
|
#define IR24_CYAN 0xF78877
|
||||||
#define IR24_AQUA 0xF7A857
|
#define IR24_AQUA 0xF7A857
|
||||||
#define IR24_BLUE 0xF7609F
|
#define IR24_BLUE 0xF7609F
|
||||||
@ -76,30 +76,30 @@
|
|||||||
#define IR24_CT_MEMORY 0xF7E817 // MEMORY
|
#define IR24_CT_MEMORY 0xF7E817 // MEMORY
|
||||||
|
|
||||||
// 24-key defs for old remote control
|
// 24-key defs for old remote control
|
||||||
#define IR24_OLD_BRIGHTER 0xFF906F // Brightness Up
|
#define IR24_OLD_BRIGHTER 0xFF906F // Brightness Up
|
||||||
#define IR24_OLD_DARKER 0xFFB847 // Brightness Down
|
#define IR24_OLD_DARKER 0xFFB847 // Brightness Down
|
||||||
#define IR24_OLD_OFF 0xFFF807 // Power OFF
|
#define IR24_OLD_OFF 0xFFF807 // Power OFF
|
||||||
#define IR24_OLD_ON 0xFFB04F // Power On
|
#define IR24_OLD_ON 0xFFB04F // Power On
|
||||||
#define IR24_OLD_RED 0xFF9867 // RED
|
#define IR24_OLD_RED 0xFF9867 // RED
|
||||||
#define IR24_OLD_REDDISH 0xFFE817 // Light RED
|
#define IR24_OLD_REDDISH 0xFFE817 // Light RED
|
||||||
#define IR24_OLD_ORANGE 0xFF02FD // Orange
|
#define IR24_OLD_ORANGE 0xFF02FD // Orange
|
||||||
#define IR24_OLD_YELLOWISH 0xFF50AF // Light Orange
|
#define IR24_OLD_YELLOWISH 0xFF50AF // Light Orange
|
||||||
#define IR24_OLD_YELLOW 0xFF38C7 // YELLOW
|
#define IR24_OLD_YELLOW 0xFF38C7 // YELLOW
|
||||||
#define IR24_OLD_GREEN 0xFFD827 // GREEN
|
#define IR24_OLD_GREEN 0xFFD827 // GREEN
|
||||||
#define IR24_OLD_GREENISH 0xFF48B7 // Light GREEN
|
#define IR24_OLD_GREENISH 0xFF48B7 // Light GREEN
|
||||||
#define IR24_OLD_TURQUOISE 0xFF32CD // TURQUOISE
|
#define IR24_OLD_TURQUOISE 0xFF32CD // TURQUOISE
|
||||||
#define IR24_OLD_CYAN 0xFF7887 // CYAN
|
#define IR24_OLD_CYAN 0xFF7887 // CYAN
|
||||||
#define IR24_OLD_AQUA 0xFF28D7 // AQUA
|
#define IR24_OLD_AQUA 0xFF28D7 // AQUA
|
||||||
#define IR24_OLD_BLUE 0xFF8877 // BLUE
|
#define IR24_OLD_BLUE 0xFF8877 // BLUE
|
||||||
#define IR24_OLD_DEEPBLUE 0xFF6897 // Dark BLUE
|
#define IR24_OLD_DEEPBLUE 0xFF6897 // Dark BLUE
|
||||||
#define IR24_OLD_PURPLE 0xFF20DF // PURPLE
|
#define IR24_OLD_PURPLE 0xFF20DF // PURPLE
|
||||||
#define IR24_OLD_MAGENTA 0xFF708F // MAGENTA
|
#define IR24_OLD_MAGENTA 0xFF708F // MAGENTA
|
||||||
#define IR24_OLD_PINK 0xFFF00F // PINK
|
#define IR24_OLD_PINK 0xFFF00F // PINK
|
||||||
#define IR24_OLD_WHITE 0xFFA857 // WHITE
|
#define IR24_OLD_WHITE 0xFFA857 // WHITE
|
||||||
#define IR24_OLD_FLASH 0xFFB24D // FLASH Mode
|
#define IR24_OLD_FLASH 0xFFB24D // FLASH Mode
|
||||||
#define IR24_OLD_STROBE 0xFF00FF // STROBE Mode
|
#define IR24_OLD_STROBE 0xFF00FF // STROBE Mode
|
||||||
#define IR24_OLD_FADE 0xFF58A7 // FADE Mode
|
#define IR24_OLD_FADE 0xFF58A7 // FADE Mode
|
||||||
#define IR24_OLD_SMOOTH 0xFF30CF // SMOOTH Mode
|
#define IR24_OLD_SMOOTH 0xFF30CF // SMOOTH Mode
|
||||||
|
|
||||||
// 40-key defs for blue remote control
|
// 40-key defs for blue remote control
|
||||||
#define IR40_BPLUS 0xFF3AC5 //
|
#define IR40_BPLUS 0xFF3AC5 //
|
||||||
@ -229,14 +229,14 @@
|
|||||||
#define COLOR_PINK 0xFF00A0
|
#define COLOR_PINK 0xFF00A0
|
||||||
#define COLOR_WHITE 0xFFFFDC
|
#define COLOR_WHITE 0xFFFFDC
|
||||||
#define COLOR_WARMWHITE2 0xFFAA69
|
#define COLOR_WARMWHITE2 0xFFAA69
|
||||||
#define COLOR_WARMWHITE 0xFFBF8E
|
#define COLOR_WARMWHITE 0xFFBF8E
|
||||||
#define COLOR_NEUTRALWHITE 0xFFD4B4
|
#define COLOR_NEUTRALWHITE 0xFFD4B4
|
||||||
#define COLOR_COLDWHITE 0xFFE9D9
|
#define COLOR_COLDWHITE 0xFFE9D9
|
||||||
#define COLOR_COLDWHITE2 0xFFFFFF
|
#define COLOR_COLDWHITE2 0xFFFFFF
|
||||||
#define COLOR2_WARMWHITE2 0xFFFF9900
|
#define COLOR2_WARMWHITE2 0xFFFFAA69
|
||||||
#define COLOR2_WARMWHITE 0xFF825A00
|
#define COLOR2_WARMWHITE 0xFFFFBF8E
|
||||||
#define COLOR2_NEUTRALWHITE 0xFF000000
|
#define COLOR2_NEUTRALWHITE 0xFFFFD4B4
|
||||||
#define COLOR2_COLDWHITE 0xFF7F7F7F
|
#define COLOR2_COLDWHITE 0xFFFFE9D9
|
||||||
#define COLOR2_COLDWHITE2 0xFFFFFFFF
|
#define COLOR2_COLDWHITE2 0xFFFFFFFF
|
||||||
|
|
||||||
#define ACTION_NONE 0
|
#define ACTION_NONE 0
|
||||||
@ -246,4 +246,4 @@
|
|||||||
#define ACTION_SPEED_DOWN 4
|
#define ACTION_SPEED_DOWN 4
|
||||||
#define ACTION_INTENSITY_UP 5
|
#define ACTION_INTENSITY_UP 5
|
||||||
#define ACTION_INTENSITY_DOWN 6
|
#define ACTION_INTENSITY_DOWN 6
|
||||||
#define ACTION_POWER 7
|
#define ACTION_POWER 7
|
||||||
|
Loading…
Reference in New Issue
Block a user