bug fix static in motor und speed
This commit is contained in:
@@ -24,8 +24,6 @@ void ManualControl::init(MoveControl *moveControl) {
|
||||
}
|
||||
|
||||
void ManualControl::loop() {
|
||||
this->moveControl->loop();
|
||||
|
||||
static uint32_t last_millis = 0;
|
||||
if (millis() - last_millis < delay) {
|
||||
return;
|
||||
|
||||
@@ -16,6 +16,7 @@ DriveManager::DriveManager(MoveControl *moveControl) {
|
||||
}
|
||||
|
||||
void DriveManager::loop() {
|
||||
this->moveControl->loop();
|
||||
if (currentModus)
|
||||
this->currentModus->loop();
|
||||
}
|
||||
@@ -31,11 +32,12 @@ void DriveManager::nextModus() {
|
||||
void DriveManager::changeModus(Modi modus) {
|
||||
|
||||
//Set moveControl to a safe state
|
||||
delete this->currentModus;
|
||||
|
||||
this->moveControl->setSpeed(0);
|
||||
this->moveControl->setRotationspeed(0);
|
||||
this->moveControl->setDrivingStatus(DrivingStatus::stop);
|
||||
delete this->currentModus;
|
||||
|
||||
|
||||
switch (modus) {
|
||||
case Modi::Off:
|
||||
this->currentModus = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user