ESP-IDF RC Motors Controls

This commit is contained in:
2024-12-31 06:12:10 -05:00
parent 2a075a7d0b
commit 660b08d8ca

View File

@@ -57,8 +57,8 @@ static esp_err_t rc_adc_init (void) {
} }
static void set_motor_pcm(int* motor , int duty) { static void set_motor_pcm(int* motor , int duty) {
if (duty >= 8191) if (abs(duty) >= 8191)
*motor = 8191; *motor = abs(8191);
else else
*motor = duty; *motor = duty;
} }