|
|
@ -79,12 +79,13 @@ bool StepMotor::moveBy(int32_t pos) { // |
|
|
|
} |
|
|
|
return m_canMaster->writeReg(m_id, m_baseCtrlPoint + SAMC_REG_ACT_MOVE_BY, pos, 20); |
|
|
|
} |
|
|
|
bool StepMotor::rotate(int32_t velocity) { //
|
|
|
|
bool StepMotor::rotate(int32_t direction) { //
|
|
|
|
if (m_fakeMotorl) { |
|
|
|
ZLOGE(TAG, "call stepmotor fail,motor is null"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return m_canMaster->writeReg(m_id, m_baseCtrlPoint + SAMC_REG_ACT_ROTATE, velocity, 20); |
|
|
|
ZLOGI(TAG, "rotate %d", direction); |
|
|
|
return m_canMaster->writeReg(m_id, m_baseCtrlPoint + SAMC_REG_ACT_ROTATE, direction, 20); |
|
|
|
} |
|
|
|
int32_t StepMotor::getPos() { |
|
|
|
if (m_fakeMotorl) { |
|
|
|