From 974118b6432177d7a0c2a7e2ff75bfce78fd2f45 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Thu, 20 Apr 2023 12:32:21 +0200 Subject: [PATCH] fix motor running with empty battery --- src/main.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 215ac1c..c5334e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -139,9 +139,7 @@ void loop() { mainBattery->loop(); if (mainBattery->isBatteryLow(10)) { - moveController.setDrivingStatus(DrivingStatus::stop); - moveController.setSpeed(0); - moveController.setRotationSpeed(0); + moveController.emergencyStop(); uint16_t voltage = (uint16_t) (mainBattery->getBatteryVoltage() * 100);