Smartcar Shield
DualMotor.cpp
Go to the documentation of this file.
1 #include "DualMotor.hpp"
2 
3 DualMotor::DualMotor(Motor& motor1, Motor& motor2)
4  : mMotor1{ motor1 }
5  , mMotor2{ motor2 }
6 {
7 }
8 
9 void DualMotor::setSpeed(int speed)
10 {
11  mMotor1.setSpeed(speed);
12  mMotor2.setSpeed(speed);
13 }
DualMotor::setSpeed
void setSpeed(int speed) override
Sets the motor speed and direction as the percentage of the maximum possible speed,...
Definition: DualMotor.cpp:9
Motor
Definition: Motor.hpp:22
Motor::setSpeed
virtual void setSpeed(int speed)=0
Sets the motor speed and direction as the percentage of the maximum possible speed,...
DualMotor.hpp
DualMotor::DualMotor
DualMotor(Motor &motor1, Motor &motor2)
Constructs a DualMotor object The two motors will spin in the same direction and at the same "speed".
Definition: DualMotor.cpp:3