Support cmd over serial
This commit is contained in:
@@ -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(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user