diff --git a/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino index ca8671566..bcb92b1ac 100644 --- a/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino +++ b/libraries/WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino @@ -60,8 +60,9 @@ void handleRoot() { static int cnt = 0; digitalWrite(led, 1); int sec = millis() / 1000; - int min = sec / 60; - int hr = min / 60; + int hr = sec / 3600; + int min = (sec / 60) % 60; + sec = sec % 60; StreamString temp; temp.reserve(500); // Preallocate a large chunk to avoid memory fragmentation @@ -80,7 +81,7 @@ void handleRoot() {

Page Count: %d

\ \ \ -", hr, min % 60, sec % 60, rp2040.getFreeHeap(), ++cnt); +", hr, min, sec, rp2040.getFreeHeap(), ++cnt); server.send(200, "text/html", temp); digitalWrite(led, 0); }