wip: add reference to motionDetection to motion
This commit is contained in:
@@ -16,12 +16,18 @@
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include "driver/ledc.h"
|
||||
#include "motionDetection/MotionDetection.h"
|
||||
#define LEDC_MODE LEDC_LOW_SPEED_MODE
|
||||
#define TIMER LEDC_TIMER_2
|
||||
#define CHANNEL_LEFT LEDC_CHANNEL_3
|
||||
#define CHANNEL_RIGHT LEDC_CHANNEL_4
|
||||
#define DUTY_RES LEDC_TIMER_13_BIT // Set duty resolution to 13 bits
|
||||
#define FREQUENCY (5000) // Frequency in Hertz. Set frequency at 5 kHz
|
||||
|
||||
struct moveCMD{
|
||||
uint32_t duration;
|
||||
MotionDetection* imu;
|
||||
};
|
||||
class Motor{
|
||||
public:
|
||||
Motor(uint8_t pin, ledc_timer_t timer, ledc_channel_t channel);
|
||||
@@ -38,6 +44,7 @@ class Motor{
|
||||
|
||||
class Motion{
|
||||
protected:
|
||||
static MotionDetection* imuInst;
|
||||
static const uint16_t RIGHT_MOTOR_DUTY = 4096;
|
||||
static const uint16_t LEFT_MOTOR_DUTY = 4096;
|
||||
static const int MOTOR_RIGHT_PIN = 11;
|
||||
@@ -50,6 +57,11 @@ public:
|
||||
//Shared Timer to sync movement
|
||||
static inline Motor left = Motor(MOTOR_LEFT_PIN,TIMER,CHANNEL_LEFT);
|
||||
static inline Motor right = Motor(MOTOR_RIGHT_PIN,TIMER,CHANNEL_RIGHT);
|
||||
friend class Dezibot;
|
||||
|
||||
/**
|
||||
* constructor gets a pointer to the motiondetection class, which enables correction of the motion
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initialize the movement component.
|
||||
|
||||
Reference in New Issue
Block a user