mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-30 21:31:06 +00:00
ESP-IDF Robot Controls
This commit is contained in:
@@ -65,13 +65,13 @@ static void rc_get_raw_data() {
|
||||
ESP_LOGI("Joystick F", "Position: %d", rescale_raw_val(adc_raw[0][1]));
|
||||
|
||||
// Cut-off readings that have values less than 700, i.e. when joystick is centered
|
||||
if (rescale_raw_val(adc_raw[0][0]) < 700 || rescale_raw_val(adc_raw[0][1]) < 700) {
|
||||
if (rescale_raw_val(adc_raw[0][0]) < 700 && rescale_raw_val(adc_raw[0][1]) < 700) {
|
||||
m.motor1_rpm_pcm = 0;
|
||||
m.motor2_rpm_pcm = 0;
|
||||
ESP_LOGW("RC", "STAD STILL");
|
||||
}
|
||||
// FORWARD
|
||||
else if ((rescale_raw_val(adc_raw[0][1]) >= 700 && rescale_raw_val(adc_raw[0][1]) < 700)) {
|
||||
else if (rescale_raw_val(adc_raw[0][1]) >= 700 && rescale_raw_val(adc_raw[0][1]) < 700) {
|
||||
m.motor1_rpm_pcm = rescale_raw_val(adc_raw[0][1]);
|
||||
ESP_LOGW("RC", "FORWARD");
|
||||
//m.motor2_rpm_pcm = rescale_raw_val(adc_raw[0][1]);
|
||||
|
Reference in New Issue
Block a user