Motor Logic

This commit is contained in:
2026-01-04 05:09:35 -05:00
parent fc3064aca8
commit cee1a09445

View File

@@ -245,17 +245,17 @@ static void update_motors_pwm (int pwm_motor_1, int pwm_motor_2) {
else if (pwm_motor_1 < -2000 && pwm_motor_2 > 1500)
{
m.motor1_rpm_pcm = 0;
m.motor2_rpm_pcm = pwm_motor_2; // right, forward
m.motor3_rpm_pcm = -pwm_motor_1; // left, reverse
m.motor2_rpm_pcm = 8190; // right, forward
m.motor3_rpm_pcm = 8190; // left, reverse
m.motor4_rpm_pcm = 0;
}
// TURN RIGHT
else if (pwm_motor_1 > 1500 && pwm_motor_2 < -2000)
{
m.motor1_rpm_pcm = pwm_motor_1; // left, forward
m.motor1_rpm_pcm = 8190; // left, forward
m.motor2_rpm_pcm = 0;
m.motor3_rpm_pcm = 0;
m.motor4_rpm_pcm = -pwm_motor_2; // right, reverse
m.motor4_rpm_pcm = 8190; // right, reverse
}