mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-20 11:31:48 +02:00
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
/**
|
|
* @file Motion.h
|
|
* @author Jonathan Schulze, Nick Hübenthal
|
|
* @brief This component controls the ability to rotate and change position.
|
|
* @version 0.1
|
|
* @date 2023-12-13
|
|
*
|
|
* @copyright Copyright (c) 2023
|
|
*
|
|
*/
|
|
|
|
#ifndef Motion_h
|
|
#define Motion_h
|
|
#include <stdint.h>
|
|
#include <Arduino.h>
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/task.h>
|
|
|
|
const int MOTOR_RIGHT_PIN = 11;
|
|
const int MOTOR_LEFT_PIN = 12;
|
|
|
|
|
|
class Motion{
|
|
protected:
|
|
|
|
public:
|
|
|
|
Motion();
|
|
|
|
/**
|
|
* @brief Initialize the movement component.
|
|
*
|
|
*/
|
|
void begin(void);
|
|
|
|
/**
|
|
* @brief Move forward for a certain amount of time.
|
|
* @param moveForMs Representing the duration of forward moving in milliseconds.
|
|
*/
|
|
void move(uint32_t moveForMs);
|
|
|
|
/**
|
|
* @brief Rotate clockwise for a certain amount of time.
|
|
* @param rotateForMs Representing the duration of rotating clockwise in milliseconds.
|
|
*/
|
|
void rotateClockwise(uint32_t rotateForMs);
|
|
|
|
/**
|
|
* @brief Rotate anticlockwise for a certain amount of time.
|
|
* @param rotateForMs Representing the duration of rotating anticlockwise in milliseconds.
|
|
*/
|
|
void rotateAnticlockwise(uint32_t rotateForMs);
|
|
|
|
};
|
|
#endif //Motion_h
|