Smartcar Shield
Loading...
Searching...
No Matches
DualMotor.cpp
Go to the documentation of this file.
1#include "DualMotor.hpp"
2
4 : mMotor1{ motor1 }
5 , mMotor2{ motor2 }
6{
7}
8
9void DualMotor::setSpeed(int speed)
10{
11 mMotor1.setSpeed(speed);
12 mMotor2.setSpeed(speed);
13}
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
void setSpeed(int speed) override
Sets the motor speed and direction as the percentage of the maximum possible speed,...
Definition DualMotor.cpp:9
Interface programmatically representing any kind of motor.
Definition Motor.hpp:23
virtual void setSpeed(int speed)=0
Sets the motor speed and direction as the percentage of the maximum possible speed,...