diff --git a/main/ugv_io.cc b/main/ugv_io.cc index 146fabc..371c6af 100644 --- a/main/ugv_io.cc +++ b/main/ugv_io.cc @@ -29,7 +29,7 @@ static constexpr mcpwm_unit_t MCPWM_UNIT = MCPWM_UNIT_0; static constexpr gpio_num_t MOTOR_LEFT_PWM = GPIO_NUM_0; static constexpr gpio_num_t MOTOR_LEFT_DIR = GPIO_NUM_2; static constexpr gpio_num_t MOTOR_RIGHT_PWM = GPIO_NUM_12; -static constexpr gpio_num_t MOTOR_RIGHT_DIR = GPIO_NUM_14; +static constexpr gpio_num_t MOTOR_RIGHT_DIR = GPIO_NUM_16; IOClass IO; @@ -46,8 +46,10 @@ void IOClass::Init() { void IOClass::InitMotors() { ERROR_CHECK(gpio_set_direction(MOTOR_LEFT_PWM, GPIO_MODE_OUTPUT)); ERROR_CHECK(gpio_set_direction(MOTOR_LEFT_DIR, GPIO_MODE_OUTPUT)); + ERROR_CHECK(gpio_set_pull_mode(MOTOR_LEFT_DIR, GPIO_FLOATING)); ERROR_CHECK(gpio_set_direction(MOTOR_RIGHT_PWM, GPIO_MODE_OUTPUT)); ERROR_CHECK(gpio_set_direction(MOTOR_RIGHT_DIR, GPIO_MODE_OUTPUT)); + ERROR_CHECK(gpio_set_pull_mode(MOTOR_RIGHT_DIR, GPIO_FLOATING)); ERROR_CHECK(mcpwm_gpio_init(MCPWM_UNIT, MCPWM0A, MOTOR_LEFT_PWM)); ERROR_CHECK(mcpwm_gpio_init(MCPWM_UNIT, MCPWM1A, MOTOR_RIGHT_PWM));