run callback in digatalControl only after rotation
finished
This commit is contained in:
@@ -85,5 +85,10 @@ void ManualControl::digitalControl() {
|
|||||||
this->moveControl->setRotationSpeed(0);
|
this->moveControl->setRotationSpeed(0);
|
||||||
|
|
||||||
if (this->directionChangeWrapper && (x > 120 || x < -120))
|
if (this->directionChangeWrapper && (x > 120 || x < -120))
|
||||||
this->directionChangeWrapper->action();
|
this->lastLoopTurned = true;
|
||||||
|
else if (this->lastLoopTurned) {
|
||||||
|
if (this->directionChangeWrapper)
|
||||||
|
this->directionChangeWrapper->action();
|
||||||
|
this->lastLoopTurned = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,8 +103,9 @@ class ManualControl : public DriveModi {
|
|||||||
void analogControl();
|
void analogControl();
|
||||||
void digitalControl();
|
void digitalControl();
|
||||||
|
|
||||||
uint32_t lastMillis = 0;
|
bool lastLoopTurned = false;
|
||||||
uint8_t delay = 10;
|
uint8_t delay = 10;
|
||||||
|
uint32_t lastMillis = 0;
|
||||||
double max_speed = 1;
|
double max_speed = 1;
|
||||||
double max_rotation = 7;
|
double max_rotation = 7;
|
||||||
CalibrateCompass* caliCompass = nullptr;
|
CalibrateCompass* caliCompass = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user