Compare commits

..

3 commits

Author SHA1 Message Date
Kai Lauterbach
790c848cc0 Updated case 3D stl file 2023-05-11 14:18:59 +02:00
Kai Lauterbach
6e4b75025f Reduced memory consumption. Reduced steps per second to reach the brightness. 2023-05-11 11:48:07 +02:00
Kai Lauterbach
4cb1007062 Indention fixed. 2023-05-11 10:59:30 +02:00
5 changed files with 11 additions and 12 deletions

Binary file not shown.

View file

@ -18,7 +18,7 @@
#define EEPROM_LAST_STATE_ADDRESS 4 // the first "last state" information for the first light #define EEPROM_LAST_STATE_ADDRESS 4 // the first "last state" information for the first light
#define EEPROM_TIMING_DATA_ADDRESS (EEPROM_LAST_STATE_ADDRESS + LIGHTS_COUNT) // Stored data date per light ELE_USED; HH; MM; CH1; CH2; CH3; CH4; #define EEPROM_TIMING_DATA_ADDRESS (EEPROM_LAST_STATE_ADDRESS + LIGHTS_COUNT) // Stored data date per light ELE_USED; HH; MM; CH1; CH2; CH3; CH4;
#define BRI_MOD_STEPS_PER_SEC 25.0 #define BRI_MOD_STEPS_PER_SEC 5
#define TIME_CHECK_INTERVAL_MS (60000UL) // 60 second interval #define TIME_CHECK_INTERVAL_MS (60000UL) // 60 second interval
#define TIME_LIGHTENGINE_INTERVAL_MS (1000UL / BRI_MOD_STEPS_PER_SEC) // BRI_MOD_STEPS_PER_SEC steps per second to in-/decrease the brightness #define TIME_LIGHTENGINE_INTERVAL_MS (1000UL / BRI_MOD_STEPS_PER_SEC) // BRI_MOD_STEPS_PER_SEC steps per second to in-/decrease the brightness

View file

@ -381,7 +381,7 @@ void init_webserver()
server.on("/state", HTTP_PUT, []() server.on("/state", HTTP_PUT, []()
{ // HTTP PUT request used to set a new light state { // HTTP PUT request used to set a new light state
DynamicJsonDocument root(1024); DynamicJsonDocument root(512);
DeserializationError error = deserializeJson(root, server.arg("plain")); DeserializationError error = deserializeJson(root, server.arg("plain"));
if (error) { if (error) {
@ -448,9 +448,9 @@ void init_webserver()
server.on("/state", HTTP_GET, []() server.on("/state", HTTP_GET, []()
{ // HTTP GET request used to fetch current light state { // HTTP GET request used to fetch current light state
uint8_t light = server.arg("light").toInt() - 1; uint8_t light = server.arg("light").toInt() - 1;
DynamicJsonDocument root(1024); DynamicJsonDocument root(512);
root["on"] = light_state[light]; root["on"] = light_state[light];
root["bri"] = bri[light]; root["bri"] = bri[light];
root["curbri"] = (int)current_bri[light]; root["curbri"] = (int)current_bri[light];
root["curpwm"] = current_pwm[light]; root["curpwm"] = current_pwm[light];
String output; String output;
@ -688,7 +688,7 @@ void init_webserver()
ESP.reset(); ESP.reset();
} }
// ***** Generate HTML page ***** // // ***** Generate static HTML page ***** //
String tmp1 = genHMTLTop(); String tmp1 = genHMTLTop();

View file

@ -329,6 +329,7 @@ function updateLightState() {
briSlider.value = data.bri; briSlider.value = data.bri;
briSliderVal.innerHTML = (Math.round((data.bri * 100.0 / 255.0) * 100) / 100).toFixed(2); briSliderVal.innerHTML = (Math.round((data.bri * 100.0 / 255.0) * 100) / 100).toFixed(2);
//console.log('data.on ' + i + ' = ' + data.on); //console.log('data.on ' + i + ' = ' + data.on);
//console.log('data light ' + i + ' = ' + data);
if (data.on == true) { if (data.on == true) {
onLinkOn.classList.add('pure-button-primary'); onLinkOn.classList.add('pure-button-primary');
onLinkOff.classList.remove('pure-button-primary'); onLinkOff.classList.remove('pure-button-primary');

View file

@ -151,8 +151,6 @@ void tc_update_main()
{ {
//Serial.println((String)tc_data[i].hh + ":" + (String)tc_data[i].mm); //Serial.println((String)tc_data[i].hh + ":" + (String)tc_data[i].mm);
/*if (tc_data[i].hh <= timeClient.getHours() &&
tc_data[i].mm <= timeClient.getMinutes())*/
if (tc_data[i].hh <= hour() && if (tc_data[i].hh <= hour() &&
tc_data[i].mm <= minute()) tc_data[i].mm <= minute())
{ {
@ -169,10 +167,10 @@ void tc_update_main()
// disable the lights // disable the lights
for (uint8_t i = 0; i < LIGHTS_COUNT; i++) for (uint8_t i = 0; i < LIGHTS_COUNT; i++)
{ {
light_state[i] = false; light_state[i] = false;
bri[i] = 0; bri[i] = 0;
current_bri[i] = 0; current_bri[i] = 0;
current_pwm[i] = 0; current_pwm[i] = 0;
transitiontime[i] = 4; transitiontime[i] = 4;
process_lightdata(i, transitiontime[i]); process_lightdata(i, transitiontime[i]);
} }