implement move method

This commit is contained in:
99cardz 2024-01-08 15:37:52 +01:00
parent 4165afd578
commit 8fa5de4b12

41
src/motion/Motion.cpp Normal file
View 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) {
}