Nettoyage de code et changement de valeurs pour toujours "plus" de précision.

This commit is contained in:
Ulysse Cura 2025-02-01 16:53:59 +01:00
parent 420e49086c
commit 27733e737a
1 changed files with 4 additions and 7 deletions

View File

@ -112,8 +112,8 @@ void loop()
case State::WaitingTimer: case State::WaitingTimer:
static unsigned long initial_time = millis(); static unsigned long initial_time = millis();
//if(millis() - initial_time >= 90000) if(millis() - initial_time >= 87000)
if(millis() - initial_time >= 2000) //if(millis() - initial_time >= 2000)
{ {
my_IO.initGyroscope(); my_IO.initGyroscope();
actual_state = State::ForwardToRamp; actual_state = State::ForwardToRamp;
@ -122,10 +122,9 @@ void loop()
case State::ForwardToRamp: case State::ForwardToRamp:
my_IO.motorControlOn(); my_IO.motorControlOn();
my_IO.setSpeed(NORMAL_SPEED);
my_IO.setSpeed(2000.0f); my_IO.setSpeed(2000.0f);
if(my_IO.getAngle(Axes::Y) < -5.0f) if(my_IO.getAngle(Axes::Y) < -8.0f)
{ {
actual_state = State::ForwardToScene; actual_state = State::ForwardToScene;
} }
@ -133,9 +132,8 @@ void loop()
case State::ForwardToScene: case State::ForwardToScene:
my_IO.setSpeed(2000.0f); my_IO.setSpeed(2000.0f);
if(my_IO.getAngle(Axes::Y) > -5.0f) if(my_IO.getAngle(Axes::Y) > -3.5f)
{ {
my_IO.setSpeed(ON_STAGE_SPEED);
my_IO.setSpeed(1300.0f); my_IO.setSpeed(1300.0f);
actual_state = my_IO.isSelectedColorBlue() ? State::Turn90Blue : State::Turn90Yellow; actual_state = my_IO.isSelectedColorBlue() ? State::Turn90Blue : State::Turn90Yellow;
//actual_state = State::Dancing; //actual_state = State::Dancing;
@ -161,7 +159,6 @@ void loop()
break; break;
case State::ForwardToSceneEdge: case State::ForwardToSceneEdge:
my_IO.setSpeed(ON_STAGE_SPEED);
my_IO.setSpeed(1100.0f); my_IO.setSpeed(1100.0f);
if(my_IO.getAngle(Axes::Y) > 3.0f) if(my_IO.getAngle(Axes::Y) > 3.0f)