mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-08-24 18:58:36 +02:00
experimenting with xTaskCreate
This commit is contained in:
@@ -20,16 +20,20 @@ Motion::Motion() {
|
||||
void Motion::begin(void) {
|
||||
|
||||
}
|
||||
|
||||
// Move forward for a certain amount of time.
|
||||
void Motion::move(uint32_t moveForMs) {
|
||||
void moveTask(void * moveForMs) {
|
||||
analogWrite(MOTOR_LEFT_PIN, 128);
|
||||
analogWrite(MOTOR_RIGHT_PIN, 128);
|
||||
vTaskDelay(moveForMs);
|
||||
vTaskDelay((uint32_t) moveForMs);
|
||||
analogWrite(MOTOR_LEFT_PIN, 0);
|
||||
analogWrite(MOTOR_RIGHT_PIN, 0);
|
||||
}
|
||||
|
||||
// Move forward for a certain amount of time.
|
||||
void Motion::move(uint32_t moveForMs) {
|
||||
xTaskCreate(moveTask, "Move", configMINIMAL_STACK_SIZE, (void*)moveForMs, 1, NULL);
|
||||
}
|
||||
|
||||
|
||||
// Rotate clockwise for a certain amount of time.
|
||||
void Motion::rotateClockwise(uint32_t rotateForMs) {
|
||||
|
||||
|
Reference in New Issue
Block a user