Ajout de la rotation dans la machine a état.
This commit is contained in:
parent
864f0128f1
commit
c71de263f8
26
Main.ino
26
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue