From 3fc065d2122b24c9a8c0d00904a3e190368ab085 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Thu, 24 Jan 2019 18:58:59 -0800 Subject: [PATCH] change io motor pins --- main/ugv_io.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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));