diff --git a/Main.ino b/Main.ino index 83eebc7..9c34bdd 100644 --- a/Main.ino +++ b/Main.ino @@ -6,7 +6,7 @@ #include "IO.hpp" // Unit tests activation -#define UNIT_TESTS +//#define UNIT_TESTS /* Etapes : @@ -136,15 +136,6 @@ void loop() break; case State::Turn90Blue: - my_IO.setDirWithAngularSpeed(90.0f); - - if(my_IO.getAngle(Axes::Z) >= 88.0f) - { - actual_state = State::ForwardToSceneEdge; - } - break; - - case State::Turn90Yellow: my_IO.setDirWithAngularSpeed(-90.0f); if(my_IO.getAngle(Axes::Z) < -88.0f) @@ -153,10 +144,19 @@ void loop() } break; - case State::ForwardToSceneEdge: - my_IO.setSpeed(2048.0f); + case State::Turn90Yellow: + my_IO.setDirWithAngularSpeed(90.0f); - if(my_IO.getAngle(Axes::Y) > 1.0f) + if(my_IO.getAngle(Axes::Z) >= 88.0f) + { + actual_state = State::ForwardToSceneEdge; + } + break; + + case State::ForwardToSceneEdge: + my_IO.setSpeed(1024.0f); + + if(my_IO.getAngle(Axes::Y) > 5.0f) { actual_state = State::Dancing; }