From 095e34ce772ee28195b08bdac8e69ae653677694 Mon Sep 17 00:00:00 2001 From: Alexandre Bobkov Date: Wed, 6 Aug 2025 04:12:14 -0400 Subject: [PATCH] pwm --- ESP-IDF_Robot/main/rc.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ESP-IDF_Robot/main/rc.h b/ESP-IDF_Robot/main/rc.h index 7dc20ea6f..63fb0e57e 100644 --- a/ESP-IDF_Robot/main/rc.h +++ b/ESP-IDF_Robot/main/rc.h @@ -113,9 +113,13 @@ static void update_pwm (int rc_x, int rc_y) { m.motor3_rpm_pcm = -(y - x); // Left side motors, reverse m.motor4_rpm_pcm = -(y + x); // Right side motors, reverse } - // Rotations - if (y < 1500) && (y > 1500) { - + // ROTATIONS + // Rotate right + if ((y < 1500) && (y > 1500)) && (x > 8000) { + m.motor1_rpm_pcm = 0; + m.motor2_rpm_pcm = 0; + m.motor3_rpm_pcm = 0; + m.motor4_rpm_pcm = 0; } // -------------