diff --git a/Code Telecommande/src/include/inputs.h b/Code Telecommande/src/include/inputs.h index b675545..f911c6a 100644 --- a/Code Telecommande/src/include/inputs.h +++ b/Code Telecommande/src/include/inputs.h @@ -22,11 +22,11 @@ typedef struct button_def_t { extern const button_def_t BUTTONS_DEFS[]; -#define JOYSTICK_X_AXIS_PIN 28 -#define JOYSTICK_Y_AXIS_PIN 27 +#define JOYSTICK_X_AXIS_PIN 27 +#define JOYSTICK_Y_AXIS_PIN 28 -#define JOYSTICK_X_AXIS_ADC_INPUT 2 -#define JOYSTICK_Y_AXIS_ADC_INPUT 1 +#define JOYSTICK_X_AXIS_ADC_INPUT 1 +#define JOYSTICK_Y_AXIS_ADC_INPUT 2 typedef struct inputs_buffer_t { int8_t x_axis_speed; diff --git a/Code Telecommande/src/inputs.c b/Code Telecommande/src/inputs.c index d298af9..02d4270 100644 --- a/Code Telecommande/src/inputs.c +++ b/Code Telecommande/src/inputs.c @@ -25,7 +25,7 @@ void inputs_init(void) const button_def_t *BUTTON_DEF = &BUTTONS_DEFS[actual_button]; gpio_init(BUTTON_DEF->pin); - gpio_set_dir(BUTTON_DEF->pin, GPIO_OUT); + gpio_set_dir(BUTTON_DEF->pin, GPIO_IN); gpio_pull_up(BUTTON_DEF->pin); controller.inputs_buffer.buttons_states[actual_button] = 0;