From 3d668c241a186ad13e4e78f860d4a1995b45e1b0 Mon Sep 17 00:00:00 2001 From: Alexandre Bobkov Date: Mon, 11 Aug 2025 01:11:08 -0400 Subject: [PATCH] PWM --- ESP-IDF_Robot/main/rc.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ESP-IDF_Robot/main/rc.h b/ESP-IDF_Robot/main/rc.h index d95df7efd..7e8948724 100644 --- a/ESP-IDF_Robot/main/rc.h +++ b/ESP-IDF_Robot/main/rc.h @@ -118,10 +118,18 @@ static void update_pwm (int rc_x, int rc_y) { // Pass PWM values to the proper DC motors depending on the joystick y-axis position // Forward if (y_val > y_centered) { - m. + m.motor1_rpm_pcm = motor_a_speed; + m.motor2_rpm_pcm = motor_b_speed; + m.motor3_rpm_pcm = 0; + m.motor4_rpm_pcm = 0; } // Reverse - if (y_val < y_centered) {} + if (y_val < y_centered) { + m.motor1_rpm_pcm = motor_a_speed; + m.motor2_rpm_pcm = motor_b_speed; + m.motor3_rpm_pcm = 0; + m.motor4_rpm_pcm = 0; + } /*