diff --git a/platformio.ini b/platformio.ini index 2c6e2717..825584ef 100644 --- a/platformio.ini +++ b/platformio.ini @@ -375,3 +375,43 @@ build_flags = ${common.build_flags_esp8266} ${common.debug_flags} ${common.build extends = env:esp32dev build_type = debug build_flags = ${common.build_flags_esp32} ${common.debug_flags} ${common.build_flags_all_features} + +# ------------------------------------------------------------------------------ +# codm pixel controller board configurations +# ------------------------------------------------------------------------------ + +[env:codm-controller-0.4] +board = esp_wroom_02 +platform = ${common.platform_wled_default} +board_build.ldscript = ${common.ldscript_2m1m} +build_flags = ${common.build_flags_esp8266} -D LEDPIN=3 + +[env:codm-controller-0.4-WS2801] +board = esp_wroom_02 +platform = ${common.platform_latest} +board_build.ldscript = ${common.ldscript_2m1m} +build_flags = ${common.build_flags_esp8266} -D USE_WS2801 -D CLKPIN=13 -D DATAPIN=3 + +[env:codm-controller-0.4-APA102] +board = esp_wroom_02 +platform = ${common.platform_latest} +board_build.ldscript = ${common.ldscript_2m1m} +build_flags = ${common.build_flags_esp8266} -D USE_APA102 -D CLKPIN=13 -D DATAPIN=3 + +[env:codm-controller-0.5] +board = esp_wroom_02 +platform = ${common.platform_wled_default} +board_build.ldscript = ${common.ldscript_2m1m} +build_flags = ${common.build_flags_esp8266} + +[env:codm-controller-0.5-WS2801] +board = esp_wroom_02 +platform = ${common.platform_latest} +board_build.ldscript = ${common.ldscript_2m1m} +build_flags = ${common.build_flags_esp8266} -D USE_WS2801 #-D CLKPIN=0 -D DATAPIN=2 + +[env:codm-controller-0.5-APA102] +board = esp_wroom_02 +platform = ${common.platform_latest} +board_build.ldscript = ${common.ldscript_2m1m} +build_flags = ${common.build_flags_esp8266} -D USE_APA102 #-D CLKPIN=0 -D DATAPIN=2 diff --git a/wled00/colors.cpp b/wled00/colors.cpp index f76499a0..361e3e06 100644 --- a/wled00/colors.cpp +++ b/wled00/colors.cpp @@ -62,7 +62,31 @@ void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); } -void colorCTtoRGB(uint16_t mired, byte* rgb) //white spectrum to rgb +void colorKtoRGB(uint16_t kelvin, byte* rgb) //white spectrum to rgb, calc +{ + float r = 0, g = 0, b = 0; + float temp = kelvin / 100; + if (temp <= 66) { + r = 255; + g = round(99.4708025861 * log(temp) - 161.1195681661); + if (temp <= 19) { + b = 0; + } else { + b = round(138.5177312231 * log((temp - 10)) - 305.0447927307); + } + } else { + r = round(329.698727446 * pow((temp - 60), -0.1332047592)); + g = round(288.1221695283 * pow((temp - 60), -0.0755148492)); + b = 255; + } + g += 15; //mod by Aircoookie, a bit less accurate but visibly less pinkish + rgb[0] = (uint8_t) constrain(r, 0, 255); + rgb[1] = (uint8_t) constrain(g, 0, 255); + rgb[2] = (uint8_t) constrain(b, 0, 255); + rgb[3] = 0; +} + +void colorCTtoRGB(uint16_t mired, byte* rgb) //white spectrum to rgb, bins { //this is only an approximation using WS2812B with gamma correction enabled if (mired > 475) { diff --git a/wled00/data/settings_sync.htm b/wled00/data/settings_sync.htm index 7c13650e..a144e76a 100644 --- a/wled00/data/settings_sync.htm +++ b/wled00/data/settings_sync.htm @@ -31,13 +31,15 @@ Infrared remote: IR info

WLED Broadcast

UDP Port:
+2nd Port:
Receive Brightness, Color, and Effects
Send notifications on direct change:
Send notifications on button press:
Send Alexa notifications:
Send Philips Hue change notifications:
Send Macro notifications:
-Send notifications twice: +Send notifications twice:
+Reboot required to apply changes.

Realtime

Receive UDP realtime:

Network DMX input
diff --git a/wled00/data/settings_time.htm b/wled00/data/settings_time.htm index c0231277..33b80af2 100644 --- a/wled00/data/settings_time.htm +++ b/wled00/data/settings_time.htm @@ -103,7 +103,11 @@ - + + + + +
UTC offset: seconds (max. 18 hours)
Current local time is unknown. diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index 86d20934..fb15e95a 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -30,6 +30,7 @@ void colorFromUint32(uint32_t in, bool secondary = false); void colorFromUint24(uint32_t in, bool secondary = false); void relativeChangeWhite(int8_t amount, byte lowerBoundary = 0); void colorHStoRGB(uint16_t hue, byte sat, byte* rgb); //hue, sat to rgb +void colorKtoRGB(uint16_t kelvin, byte* rgb); void colorCTtoRGB(uint16_t mired, byte* rgb); //white spectrum to rgb void colorXYtoRGB(float x, float y, byte* rgb); // only defined if huesync disabled TODO @@ -102,6 +103,10 @@ void updateInterfaces(uint8_t callMode); void handleTransitions(); void handleNightlight(); +//lx_parser.cpp +bool parseLx(int lxValue, byte* rgbw); +void parseLxJson(int lxValue, byte segId, bool secondary); + //mqtt.cpp bool initMqtt(); void publishMqtt(); diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 22ed90ca..258a2111 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -233,23 +233,23 @@ var t = typeof s[i]; if (gId(fk)) { //already exists if(t === 'boolean') { - gId(fk).checked = s[i]; +gId(fk).checked = s[i]; } else { - gId(fk).value = s[i]; +gId(fk).value = s[i]; } if (gId(fk).previousElementSibling.matches('.l')) { - gId(fk).previousElementSibling.innerHTML = lb; +gId(fk).previousElementSibling.innerHTML = lb; } } else { if(t === 'boolean') { - str += `${lb}:
`; +str += `${lb}:
`; } else if (t === 'number') { - str += `${lb}:
`; +str += `${lb}:
`; } else if (t === 'string') { - str += `${lb}:

`; +str += `${lb}:

`; } } } @@ -370,28 +370,31 @@ On/Off button enabled:
Infrared remote: 9-key red
IR info

WLED Broadcast

UDP Port:
Receive Brightness, Color, and Effects
Send notifications on direct change:
Send notifications on button press:
Send Alexa notifications:
Send Philips Hue change notifications:
Send Macro notifications:
-Send notifications twice:

Realtime

-Receive UDP realtime:

-Network DMX input
Type:
-Port:
Multicast:
-Start universe:
-Reboot required. Check out LedFx!
Skip out-of-sequence packets:
DMX start address:
DMX mode:

2nd Port:
Receive Brightness, +Color, and Effects
+Send notifications on direct change:
+Send notifications on button press:
+Send Alexa notifications:
+Send Philips Hue change notifications:
+Send Macro notifications:
+Send notifications twice:
+Reboot required to apply changes.

Realtime

Receive UDP realtime: +

Network DMX input
Type: +
Port: +
Multicast:
Start universe:
Reboot required. + Check out
LedFx +!
Skip out-of-sequence packets:
+DMX start address: +
DMX mode:
E1.31 info
Timeout: ms
Force max brightness:
@@ -450,7 +453,9 @@ value="5">US-CST/CDT
UTC offset:
UTC offset: seconds (max. 18 hours)
Current local time is unknown.

Clock

Clock Overlay: