feat: 修正左右电机物理方向差异
This commit is contained in:
@@ -71,6 +71,11 @@ void motor_set_speed(motor_id_t motor_id, int16_t speed)
|
|||||||
default: return;
|
default: return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 纠正左右电机物理方向差异 */
|
||||||
|
if (motor_id == MOTOR_3 || motor_id == MOTOR_4) {
|
||||||
|
speed = -speed;
|
||||||
|
}
|
||||||
|
|
||||||
/* 限制速度范围 (ARR=3599) */
|
/* 限制速度范围 (ARR=3599) */
|
||||||
if (speed > 3599) speed = 3599;
|
if (speed > 3599) speed = 3599;
|
||||||
if (speed < -3599) speed = -3599;
|
if (speed < -3599) speed = -3599;
|
||||||
|
|||||||
Reference in New Issue
Block a user