ESP-IDF Robot Controls

This commit is contained in:
2024-12-28 22:43:58 -05:00
parent a6b973b6a2
commit aa7c4a7acb
3 changed files with 3 additions and 3 deletions

View File

View File

@@ -114,7 +114,7 @@ static adc_channel_t channel[2] = {ADC_CHANNEL_0, ADC_CHANNEL_1};
#endif
// Declare struct to hold motors RPMs
Motors *motors;
Motors *m;
static QueueHandle_t gpio_evt_queue = NULL;
static uint8_t s_led_state = 0;

View File

@@ -15,7 +15,7 @@
//static const char *TAG = "ESP IDF Robot";
//Motors *m;
//Motors *motors;
static int adc_raw[2][10];
@@ -61,7 +61,7 @@ static void rc_get_raw_data() {
ESP_LOGI("ESP IDF Robot", "ADC%d Channel[%d] Raw Data: %d", ADC_UNIT_1 + 1, ADC1_CHAN1, adc_raw[0][1]);
ESP_LOGI("Joystick", "Position: %d", interpolate_raw_val(adc_raw[0][0]));
ESP_LOGI("Joystick", "Position: %d", interpolate_raw_val(adc_raw[0][1]));
motors.motor1_rpm_pcm = interpolate_raw_val(adc_raw[0][1]);
m.motor1_rpm_pcm = interpolate_raw_val(adc_raw[0][1]);
if (do_calibration1_chan0) {
ESP_ERROR_CHECK(adc_cali_raw_to_voltage(adc1_cali_chan0_handle, adc_raw[0][0], &voltage[0][0]));