Smartcar Shield
DualMotor.hpp
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <stdint.h> // NOLINT(modernize-deprecated-headers)
11 
12 #include "../Motor.hpp"
13 
14 class DualMotor : public Motor
15 {
16 public:
24  DualMotor(Motor& motor1, Motor& motor2);
25 
26  /* Check `Motor` interface for documentation */
27  void setSpeed(int speed) override;
28 
29 private:
30  Motor& mMotor1;
31  Motor& mMotor2;
32 };
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
DualMotor
Definition: DualMotor.hpp:14
Motor
Definition: Motor.hpp:22
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