Browse Source

update

master
zhaohe 1 year ago
parent
commit
e5ce8da200
  1. 10
      components/step_motor_ctrl_module/step_motor_ctrl_module.cpp

10
components/step_motor_ctrl_module/step_motor_ctrl_module.cpp

@ -547,10 +547,12 @@ int32_t StepMotorCtrlModule::do_step_motor_easy_rotate(int32_t direction) {
[this, direction]() {
befor_motor_move();
{
m_stepM1->set_amax(m_cfg.motor_amax);
int32_t vel = m_cfg.motor_default_velocity;
if (direction <= 0) vel = -vel;
m_stepM1->rotate(vel);
// m_stepM1->set_amax(m_cfg.motor_amax);
// int32_t vel = m_cfg.motor_default_velocity;
// if (direction <= 0) vel = -vel;
// m_stepM1->rotate(vel);
m_stepM1->moveToEnd(direction, m_cfg.motor_default_velocity);
while (true) {
if (m_thread.getExitFlag()) break;

Loading…
Cancel
Save