From a6b028b701a6f726289880eae3c1e9317dc99d7d Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Sat, 1 Feb 2025 06:06:13 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20rotation=20dans=20la=20machin?= =?UTF-8?q?e=20a=20=C3=A9tat.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main.ino | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Main.ino b/Main.ino index 83eebc7..4257e6f 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) > 2.0f) { actual_state = State::Dancing; }