diff --git a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp index 507f2c5..76703a4 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -129,7 +129,7 @@ int32_t StepMotorCtrlModule::step_motor_easy_rotate(int32_t direction) { m_stepM1->setDeceleration(m_cfg.motor_default_dec); int32_t vel = m_cfg.motor_default_velocity; - if (direction == 0) vel = -vel; + if (direction <= 0) vel = -vel; m_stepM1->rotate(vel); while (true) {