mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2026-01-24 22:45:13 +00:00
Motor Logic
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user