This commit is contained in:
cally22
2023-07-07 21:57:41 +02:00
commit dc5f14256e
12 changed files with 523 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
// MOTOR.h
#ifndef MOTOR_h
#define MOTOR_h
#include <Servo.h>
#include <Arduino.h>
#include "enums.h" // Include the enums header file
class MOTOR {
private:
int pinESC;
Servo esc;
int currentSpeed;
void setSpeedInternal(int speed);
MotorPosition motorPosition;
public:
const int minSpeed = 1000;
const int maxSpeed = 2000;
const int speedInterval = 10;
void setMotorPosition(MotorPosition mp);
void setPinESC(int pin);
void setSpeed(int speed);
int getSpeed();
void accelerate();
void decelerate();
};
#endif