fixed web-control path and watchdog stoping

This commit is contained in:
Helva
2026-02-08 14:04:31 +01:00
parent f75c654a39
commit 4b040391da
2 changed files with 21 additions and 3 deletions
+16 -1
View File
@@ -265,7 +265,22 @@
lastL = L; lastR = R;
readoutEl.textContent = `T ${throttle.toFixed(2)} | Turn ${turn.toFixed(2)} → L ${L} | R ${R}`;
sendLR(L, R, force);
// sendLR(L, R, force);
// ---- Heartbeat: keep sending current values while driving ----
setInterval(() => {
// wenn nicht verbunden -> nix
if (!connected) return;
// Wenn du NUR beim aktiven Fahren senden willst:
const driving = (Math.abs(throttle) > 0.02) || (Math.abs(turn) > 0.02);
if (driving) {
// erzwinge Senden auch wenn sich nichts geändert hat
sendLR(lastL, lastR, true);
}
}, 400); // 40 Hz
}
function hardStop() {