Smartcar Shield
Loading...
Searching...
No Matches
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
14class DualMotor : public Motor
15{
16public:
24 DualMotor(Motor& motor1, Motor& motor2);
25
26 /* Check `Motor` interface for documentation */
27 void setSpeed(int speed) override;
28
29private:
30 Motor& mMotor1;
31 Motor& mMotor2;
32};
A set of two motors that should always spin in the same way while being controlled by different pins.
Definition DualMotor.hpp:15
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