Compare commits
2 Commits
441a32154d
...
94448fc0fe
Author | SHA1 | Date |
---|---|---|
gilex-dev | 94448fc0fe | |
gilex-dev | 8791fc1ed0 |
|
@ -16,3 +16,4 @@ upload_speed = 921600
|
|||
monitor_speed = 74880
|
||||
lib_deps =
|
||||
ropg/ezTime@^0.8.3
|
||||
paulstoffregen/OneWire@^2.3.7
|
||||
|
|
21
src/html.cpp
21
src/html.cpp
|
@ -2,6 +2,23 @@
|
|||
#include <Arduino.h>
|
||||
|
||||
void reload_home() {
|
||||
char time_current[3][3] = {"", "", ""};
|
||||
if (myTime.hour() < 10) {
|
||||
sprintf(time_current[0], "0%d", myTime.hour());
|
||||
} else {
|
||||
sprintf(time_current[0], "%d", myTime.hour());
|
||||
}
|
||||
if (myTime.minute() < 10) {
|
||||
sprintf(time_current[1], "0%d", myTime.minute());
|
||||
} else {
|
||||
sprintf(time_current[1], "%d", myTime.minute());
|
||||
}
|
||||
if (myTime.second() < 10) {
|
||||
sprintf(time_current[2], "0%d", myTime.second());
|
||||
} else {
|
||||
sprintf(time_current[2], "%d", myTime.second());
|
||||
}
|
||||
|
||||
sprintf(home_html, "<!DOCTYPE html>\
|
||||
<html lang='de'>\
|
||||
<head>\
|
||||
|
@ -62,7 +79,7 @@ void reload_home() {
|
|||
<body>\
|
||||
<div class='wrapper_main'>\
|
||||
<h1>Übersicht</h1>\
|
||||
<h2>Uhrzeit: <span>%02d:%02d:%02d</span></h2>\
|
||||
<h2>Uhrzeit: <span>%s:%s:%s</span></h2>\
|
||||
<div class='wrapper_form'>\
|
||||
<div>\
|
||||
<span>Ventil 1: </span>\
|
||||
|
@ -103,7 +120,7 @@ void reload_home() {
|
|||
</div>\
|
||||
</body>\
|
||||
</html>",
|
||||
myTime.hour(), myTime.minute(), myTime.second(), stat[0], stat[1],
|
||||
time_current[0], time_current[1], time_current[2], stat[0], stat[1],
|
||||
stat[2], stat[3], stat[4], stat[5], stat[6], stat[7]);
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,11 @@ void load_EEPROM() {
|
|||
unsigned int EEPROM_Addr = 0;
|
||||
for (unsigned int i0 = 0; i0 < 8; i0++) {
|
||||
for (unsigned int i = 0; i < 8; i++) {
|
||||
sprintf(time_all[i0][i], "%02d", EEPROM.read(EEPROM_Addr));
|
||||
if (EEPROM.read(EEPROM_Addr) < 10) {
|
||||
sprintf(time_all[i0][i], "0%d", EEPROM.read(EEPROM_Addr));
|
||||
} else {
|
||||
sprintf(time_all[i0][i], "%d", EEPROM.read(EEPROM_Addr));
|
||||
}
|
||||
EEPROM_Addr += 4;
|
||||
yield();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue