fix: correct interval for fetching sensor data to every 5 seconds

This commit is contained in:
ishak jmilou.ishak
2024-12-20 14:10:14 +01:00
parent 5dbbad5fff
commit 2f06927550

View File

@@ -50,6 +50,9 @@ document.addEventListener("DOMContentLoaded", function () {
sensorDataContainer.appendChild(row); sensorDataContainer.appendChild(row);
}); });
} }
setInterval(parseData, 1000);
// Update the image // Update the image
function updateImage() { function updateImage() {
var img = document.getElementById("robot-image"); var img = document.getElementById("robot-image");
@@ -57,7 +60,6 @@ document.addEventListener("DOMContentLoaded", function () {
} }
// Fetch and display sensor data every 5 seconds // Fetch and display sensor data every 5 seconds
setInterval(parseData, 1000);
// Update the image every 5 seconds // Update the image every 5 seconds
setInterval(updateImage, 200); setInterval(updateImage, 200);