-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMotorController.hpp
More file actions
executable file
·31 lines (20 loc) · 898 Bytes
/
Copy pathMotorController.hpp
File metadata and controls
executable file
·31 lines (20 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef MOTOR_CONTROLLER_H
#define MOTOR_CONTROLLER_H
#include "ThunderborgDriver.hpp"
const uint8_t MAX_POWER = PWM_MAX * 0.95; //Maximum motor power, we limit it to 95% to allow the RPi to get uninterrupted power
class MotorController
{
public:
MotorController(ThunderborgDriver& thunderborgDriverInput) : thunderborgDriver(thunderborgDriverInput){};
void performMove(uint8_t leftDirection, uint8_t rightDirection, uint32_t milliseconds);
void performSpin(float angle);
void driveForward(uint32_t centimeters);
void driveBackwords(uint32_t centimeters);
private:
//Private and unimplemented copy constructor
MotorController( const MotorController& );
//Private and unimplemented equals operator
MotorController& operator=( const MotorController& );
ThunderborgDriver& thunderborgDriver;
};
#endif