2019-11-11 22:26:34 +01:00
|
|
|
#pragma once
|
|
|
|
|
2019-10-21 08:06:37 +02:00
|
|
|
#include <Arduino.h>
|
2021-02-22 18:43:43 +01:00
|
|
|
#include "behaviour_control/complementary_filter.h"
|
|
|
|
|
|
|
|
#define DRIVE_DURATION_MS 5
|
2019-10-21 08:06:37 +02:00
|
|
|
|
|
|
|
class Motor {
|
|
|
|
|
|
|
|
public:
|
2019-11-11 22:26:34 +01:00
|
|
|
Motor(int a, int b, int pwm, int angle);
|
2019-11-13 16:26:03 +01:00
|
|
|
Motor();
|
2019-11-11 22:26:34 +01:00
|
|
|
void drive(int speed);
|
2020-03-03 11:52:39 +01:00
|
|
|
void test();
|
2021-03-01 16:28:01 +01:00
|
|
|
|
2019-10-21 08:06:37 +02:00
|
|
|
public:
|
2021-03-01 16:28:01 +01:00
|
|
|
int angle;
|
2019-10-21 08:06:37 +02:00
|
|
|
|
2021-03-01 16:28:01 +01:00
|
|
|
private:
|
|
|
|
int pinA, pinB, pinPwm;
|
|
|
|
ComplementaryFilter* filter;
|
2019-10-21 08:06:37 +02:00
|
|
|
};
|