Support cmd over serial

This commit is contained in:
2026-03-01 20:56:41 +01:00
parent f155d16399
commit 9ca311cf63

View File

@@ -274,6 +274,13 @@ void loop() {
}
#endif
// Serial commands: 'c' = calibrate, 'r' = factory reset
while (Serial.available()) {
char cmd = Serial.read();
if (cmd == 'c') { Serial.println("[SERIAL] Calibrate"); pendingCal = true; }
if (cmd == 'r') { Serial.println("[SERIAL] Reset"); pendingReset = true; }
}
if (pendingCal) { pendingCal = false; calibrateGyroBias(); }
if (pendingReset) { pendingReset = false; factoryReset(); }