This commit is contained in:
2025-01-05 14:27:23 -05:00
parent 5f325e55e6
commit 62edf51f48

View File

@@ -19,12 +19,10 @@ static esp_err_t joystick_adc_init() {
adc_oneshot_chan_cfg_t config_x = { adc_oneshot_chan_cfg_t config_x = {
.bitwidth = SOC_ADC_DIGI_MAX_BITWIDTH, .bitwidth = SOC_ADC_DIGI_MAX_BITWIDTH,
.atten = ADC_ATTEN_DB_11, .atten = ADC_ATTEN_DB_11,
}; };
adc_oneshot_chan_cfg_t config_y = { adc_oneshot_chan_cfg_t config_y = {
.bitwidth = SOC_ADC_DIGI_MAX_BITWIDTH, .bitwidth = SOC_ADC_DIGI_MAX_BITWIDTH,
.atten = ADC_ATTEN_DB_11, .atten = ADC_ATTEN_DB_11,
}; };
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC1_CHANNEL_0, &config_x)); ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC1_CHANNEL_0, &config_x));
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC1_CHANNEL_1, &config_y)); ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC1_CHANNEL_1, &config_y));