mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-10-01 12:15:50 +00:00
RC
This commit is contained in:
0
ESP-IDF_Robot_RC/build/.ninja_lock
Normal file
0
ESP-IDF_Robot_RC/build/.ninja_lock
Normal file
@@ -1 +1 @@
|
|||||||
584b31aada19a08d6a89f83bd543c45bc682046f
|
4a1c0cb2c3226c7953193e71c207afd5c8f89396
|
||||||
|
@@ -8,14 +8,14 @@
|
|||||||
#include "esp_adc/adc_oneshot.h"
|
#include "esp_adc/adc_oneshot.h"
|
||||||
|
|
||||||
static unsigned int x, y;
|
static unsigned int x, y;
|
||||||
adc_oneshot_unit_handle_t adc_x_handle, adc_y_handle;
|
adc_oneshot_unit_handle_t adc_x_handle, adc_y_handle, adc_xy_handle;
|
||||||
|
|
||||||
static esp_err_t joystick_adc_init() {
|
static esp_err_t joystick_adc_init() {
|
||||||
adc_oneshot_unit_init_cfg_t adc_init_config_xy = {
|
adc_oneshot_unit_init_cfg_t adc_init_config_xy = {
|
||||||
.unit_id = ADC_UNIT_1,
|
.unit_id = ADC_UNIT_1,
|
||||||
};
|
};
|
||||||
ESP_ERROR_CHECK(adc_oneshot_new_unit(&adc_init_config_xy, &adc_x_handle));
|
ESP_ERROR_CHECK(adc_oneshot_new_unit(&adc_init_config_xy, &adc_xy_handle));
|
||||||
ESP_ERROR_CHECK(adc_oneshot_new_unit(&adc_init_config_xy, &adc_y_handle));
|
//ESP_ERROR_CHECK(adc_oneshot_new_unit(&adc_init_config_xy, &adc_xy_handle));
|
||||||
|
|
||||||
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,
|
||||||
@@ -27,8 +27,8 @@ static esp_err_t joystick_adc_init() {
|
|||||||
.atten = ADC_ATTEN_DB_11,
|
.atten = ADC_ATTEN_DB_11,
|
||||||
|
|
||||||
};
|
};
|
||||||
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_x_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_y_handle, ADC1_CHANNEL_1, &config_y));
|
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC1_CHANNEL_1, &config_y));
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user