ESP-IDF Robot Controls

This commit is contained in:
2024-12-29 02:30:04 -05:00
parent 2af9d6e326
commit f818d395d9

View File

@@ -75,9 +75,14 @@ static void rc_get_raw_data() {
m.motor2_rpm_pcm = 0;
}
// LEFT or RIGHT
// RIGHT
if (rescale_raw_val(adc_raw[0][0]) >= 4000) {
m.motor1_rpm_pcm = rescale_raw_val(adc_raw[0][0]);
}
// LEFT
else if (rescale_raw_val(adc_raw[0][0]) <= 2000) {
m.motor1_rpm_pcm = rescale_raw_val(adc_raw[0][0]);
}
else {
m.motor1_rpm_pcm = 0;
}