From 548b5b8d51bb2859c8a13e3c989bbdf62b37cfdf Mon Sep 17 00:00:00 2001 From: jonny_l480 Date: Mon, 11 Sep 2023 21:24:38 +0200 Subject: [PATCH] Hotfix: swap joystick X/Y pins, log 5V regulator start jsut re-wired the pcb. apparently joystick was wired wrong previously --- board_single/main/config.cpp | 4 ++-- board_single/main/main.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/board_single/main/config.cpp b/board_single/main/config.cpp index b1fbb87..b4f01cc 100644 --- a/board_single/main/config.cpp +++ b/board_single/main/config.cpp @@ -93,8 +93,8 @@ httpJoystick_config_t configHttpJoystickMain{ //======= joystick configuration ======= //====================================== joystick_config_t configJoystick = { - .adc_x = ADC1_CHANNEL_3, //GPIO39 - .adc_y = ADC1_CHANNEL_0, //GPIO36 + .adc_x = ADC1_CHANNEL_0, //GPIO36 + .adc_y = ADC1_CHANNEL_3, //GPIO39 //percentage of joystick range the coordinate of the axis snaps to 0 (0-100) .tolerance_zeroX_per = 7, //6 .tolerance_zeroY_per = 10, //7 diff --git a/board_single/main/main.cpp b/board_single/main/main.cpp index 7ed2781..0127dc1 100644 --- a/board_single/main/main.cpp +++ b/board_single/main/main.cpp @@ -167,6 +167,7 @@ void sendByte(char data){ //================================= extern "C" void app_main(void) { //enable 5V volate regulator + ESP_LOGW(TAG, "enabling 5V regulator..."); gpio_pad_select_gpio(GPIO_NUM_17); gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT); gpio_set_level(GPIO_NUM_17, 1);