5 #include "hardwareinterface/MotorAdapter.h" 8 this->m_pwmHat = m_pwmHat;
9 this->forwardPin = forwardPin;
10 this->backwardPin = backwardPin;
29 void MotorAdapter::driveMotor(
int speed) {
32 m_pwmHat->
setMotor(this->forwardPin, abs(speed));
33 m_pwmHat->
setMotor(this->backwardPin, 0);
35 m_pwmHat->
setMotor(this->forwardPin, 0);
36 m_pwmHat->
setMotor(this->backwardPin, abs(speed));
void write(IMessage *msg) override
MotorAdapter(AdafruitPWMServoHat *m_pwmHat, int forwardPin, int backwardPin)
bool setMotor(int motorID, int speed)