Files
DroneReceiver/DRONE.h
T
2023-07-09 20:04:44 +02:00

35 lines
763 B
C++

// DRONE.h
#ifndef DRONE_h
#define DRONE_h
#include <Arduino.h>
#include "MOTOR.h"
#include "RadioController.h"
#include "GYRO.h"
#include "enums.h" // Include the enums header file
#include "structs.h" // Include the structs header file
class DRONE {
private:
MOTOR back_right;
MOTOR back_left;
MOTOR front_right;
MOTOR front_left;
void updateMotors(float* mpuValues);
public:
RadioController radio;
GYRO gyro;
DRONE();
void setPinESC(int pin, MotorPosition mp, int speedOffset);
void setSpeed(int speed, MotorPosition mp);
void accelerate();
void decelerate();
void stop();
String getSpeedFromMotor(MotorPosition mp);
bool initReceiver(int cepin, int cspin);
void update();
};
#endif