ESP-IDF Robot Controls

This commit is contained in:
2024-12-31 03:40:20 -05:00
parent 739e3fd1e5
commit eb764d88ce

View File

@@ -68,7 +68,8 @@ static void rc_get_raw_data() {
int y = rescale_raw_val(adc_raw[0][1]); int y = rescale_raw_val(adc_raw[0][1]);
if ((x > 0 && x < 500) && (y > 500)) { if ((x > 0 && x < 500) && (y > 500)) {
ESP_LOGW("RC", "FORWARD"); ESP_LOGW("RC", "FORWARD");
m.motor1_rpm_pcm = rescale_raw_val(adc_raw(y)); m.motor1_rpm_pcm = rescale_raw_val(y);
m.motor2_rpm_pcm = 0;
} }
else if ((x > 0 && x < 500) && (y < -200)) else if ((x > 0 && x < 500) && (y < -200))
ESP_LOGW("RC", "REVERSE"); ESP_LOGW("RC", "REVERSE");