 |
Dezibot 4
|
Go to the documentation of this file.
19 ledc_timer_config_t motor_timer = {
24 .clk_cfg = LEDC_AUTO_CLK
26 ledc_timer_config(&motor_timer);
32 uint32_t runtime = (uint32_t)args;
38 if(runtime>40||runtime==0){
47 for(
int i = 0;i<fifocount;i++){
54 int difference = abs(leftCounter-rightCounter);
57 }
else if(difference>20){
59 }
else if(difference >15){
61 }
else if(difference > 10){
67 if(leftCounter>rightCounter){
70 }
else if(leftCounter<rightCounter){
109 uint32_t runtime = (uint32_t)args;
121 if((runtime>40)||(runtime==0)){
137 if (rotateForMs > 0){
149 uint32_t runtime = (uint32_t)args;
161 if(runtime>40||runtime==0){
static void leftMotorTask(void *args)
static uint16_t RIGHT_MOTOR_DUTY
static TaskHandle_t xMoveTaskHandle
static void stop(void)
stops any current movement, no matter if timebased or endless
This component controls the ability to rotate and change position.
static int correctionThreshold
void begin(void)
Initializes the motor.
static void move(uint32_t moveForMs=0, uint baseValue=DEFAULT_BASE_VALUE)
Move forward for a certain amount of time. Call with moveForMs 0 will start movement,...
static FIFO_Package * buffer
static void rotateAntiClockwise(uint32_t rotateForMs=0, uint baseValue=DEFAULT_BASE_VALUE)
Rotate anticlockwise for a certain amount of time. Call with moveForMs 0 will start movement,...
uint getDataFromFIFO(FIFO_Package *buffer)
will read all availible packages from fifo, after 40ms Fifo is full
static void rightMotorTask(void *args)
void begin(void)
initialized the IMU Component. Wakes the IMU from Standby Set configuration
static TickType_t xLastWakeTime
static void rotateClockwise(uint32_t rotateForMs=0, uint baseValue=DEFAULT_BASE_VALUE)
Rotate clockwise for a certain amount of time. Call with moveForMs 0 will start movement,...
void setSpeed(uint16_t duty)
Set the Speed by changing the pwm. To avoid current peaks, a linear ramp-up is used.
static void moveTask(void *args)
static TaskHandle_t xAntiClockwiseTaskHandle
static TaskHandle_t xClockwiseTaskHandle
static uint16_t LEFT_MOTOR_DUTY
static MotionDetection detection
void begin(void)
Initialize the movement component.