mirror of
https://github.com/eclipse/upm.git
synced 2025-07-04 10:51:12 +03:00
grovemd: allow seperate directions for each DC motor
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
d380658b40
commit
970d6a083f
@ -108,12 +108,13 @@ bool GroveMD::setPWMFrequencyPrescale(uint8_t freq)
|
||||
return writePacket(SET_PWM_FREQ, freq, GROVEMD_NOOP);
|
||||
}
|
||||
|
||||
bool GroveMD::setDirection(DIRECTION_T dir)
|
||||
bool GroveMD::setMotorDirections(DC_DIRECTION_T dirA, DC_DIRECTION_T dirB)
|
||||
{
|
||||
uint8_t dir = ((dirB & 0x03) << 2) | (dirA & 0x03);
|
||||
return writePacket(SET_DIRECTION, dir, GROVEMD_NOOP);
|
||||
}
|
||||
|
||||
bool GroveMD::enableStepper(DIRECTION_T dir, uint8_t speed)
|
||||
bool GroveMD::enableStepper(STEP_DIRECTION_T dir, uint8_t speed)
|
||||
{
|
||||
return writePacket(STEPPER_ENABLE, dir, speed);
|
||||
}
|
||||
|
Reference in New Issue
Block a user