mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-20 19:41:47 +02:00
implement move method
This commit is contained in:
parent
4165afd578
commit
8fa5de4b12
41
src/motion/Motion.cpp
Normal file
41
src/motion/Motion.cpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* @file Motion.cpp
|
||||||
|
* @author Jonathan Schulze, Nick Hübenthal
|
||||||
|
* @brief Implementation of the Motion class.
|
||||||
|
* @version 0.1
|
||||||
|
* @date 2023-12-13
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2023
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Motion.h"
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
Motion::Motion() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize the movement component.
|
||||||
|
void Motion::begin(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move forward for a certain amount of time.
|
||||||
|
void Motion::move(uint32_t moveForMs) {
|
||||||
|
analogWrite(MOTOR_LEFT_PIN, 128);
|
||||||
|
analogWrite(MOTOR_RIGHT_PIN, 128);
|
||||||
|
vTaskDelay(moveForMs);
|
||||||
|
analogWrite(MOTOR_LEFT_PIN, 0);
|
||||||
|
analogWrite(MOTOR_RIGHT_PIN, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rotate clockwise for a certain amount of time.
|
||||||
|
void Motion::rotateClockwise(uint32_t rotateForMs) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rotate anticlockwise for a certain amount of time.
|
||||||
|
void Motion::rotateAnticlockwise(uint32_t rotateForMs) {
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user