mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-13 08:40:13 +00:00
ESP-IDF Robot Controls
This commit is contained in:
@@ -75,9 +75,14 @@ static void rc_get_raw_data() {
|
|||||||
m.motor2_rpm_pcm = 0;
|
m.motor2_rpm_pcm = 0;
|
||||||
}
|
}
|
||||||
// LEFT or RIGHT
|
// LEFT or RIGHT
|
||||||
|
// RIGHT
|
||||||
if (rescale_raw_val(adc_raw[0][0]) >= 4000) {
|
if (rescale_raw_val(adc_raw[0][0]) >= 4000) {
|
||||||
m.motor1_rpm_pcm = rescale_raw_val(adc_raw[0][0]);
|
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 {
|
else {
|
||||||
m.motor1_rpm_pcm = 0;
|
m.motor1_rpm_pcm = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user