ESP-IDF Robot Controls

This commit is contained in:
2024-12-31 02:38:40 -05:00
parent f95026601a
commit 2ab10dcc8d
3 changed files with 2 additions and 7 deletions

View File

View File

@@ -1 +1 @@
aa19f5c0c6679e7255cbb2566374a71add7a8209
f95026601a5d80f45552e2229fc8195791405e76

View File

@@ -66,6 +66,7 @@ static void rc_get_raw_data() {
// Cut-off readings that have values less than 700, i.e. when joystick is centered
if (rescale_raw_val(adc_raw[0][0]) < 500 && rescale_raw_val(adc_raw[0][1]) < 500) {
// REVERSE
if (rescale_raw_val(adc_raw[0][1] < -1400))
ESP_LOGW("RC", "REVERSE");
else {
@@ -80,12 +81,6 @@ static void rc_get_raw_data() {
ESP_LOGW("RC", "FORWARD");
//m.motor2_rpm_pcm = rescale_raw_val(adc_raw[0][1]);
}
// REVERSE
else if (rescale_raw_val(adc_raw[0][1]) <= 500 && rescale_raw_val(adc_raw[0][0]) < 500) {
m.motor1_rpm_pcm = rescale_raw_val(adc_raw[0][1]);
ESP_LOGW("RC", "REVERSE");
//m.motor2_rpm_pcm = rescale_raw_val(adc_raw[0][1]);
}
else {
m.motor1_rpm_pcm = 0;
m.motor2_rpm_pcm = 0;