From 9ca311cf63bbdb0588137c08f1f3a2b69e619eee Mon Sep 17 00:00:00 2001 From: Nik Rozman Date: Sun, 1 Mar 2026 20:56:41 +0100 Subject: [PATCH] Support cmd over serial --- source/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/main.cpp b/source/main.cpp index 5502269..87d7ba3 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -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(); }