From 2e498f2af1f92ed84ca57c2ebf8fc6824e9ee9ab Mon Sep 17 00:00:00 2001 From: Alexander Bobkov Date: Sun, 29 Dec 2024 01:58:44 -0500 Subject: [PATCH] ESP-IDF Robot Controls --- ESP-IDF_Robot/main/motor_controls.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ESP-IDF_Robot/main/motor_controls.h b/ESP-IDF_Robot/main/motor_controls.h index 712d730ee..5097f03c3 100644 --- a/ESP-IDF_Robot/main/motor_controls.h +++ b/ESP-IDF_Robot/main/motor_controls.h @@ -21,6 +21,8 @@ static int rescale_raw_val (int raw) { int s; s = 4*raw - 8940; + if (s < 0) + s = 0; return s; }