Normalisation des vitesses.
This commit is contained in:
parent
a2d0072635
commit
cd937c5e50
15
Main.ino
15
Main.ino
|
@ -5,6 +5,10 @@
|
|||
|
||||
#include "IO.hpp"
|
||||
|
||||
#define NORMAL_SPEED 2048.0f
|
||||
#define TURNING_SPEED 1500.0f
|
||||
#define ON_STAGE_SPEED 1120.0f
|
||||
|
||||
// Unit tests activation
|
||||
//#define UNIT_TESTS
|
||||
|
||||
|
@ -108,8 +112,8 @@ void loop()
|
|||
case State::WaitingTimer:
|
||||
static unsigned long initial_time = millis();
|
||||
|
||||
if(millis() - initial_time >= 90000)
|
||||
//if(millis() - initial_time >= 2000)
|
||||
//if(millis() - initial_time >= 90000)
|
||||
if(millis() - initial_time >= 2000)
|
||||
{
|
||||
my_IO.initGyroscope();
|
||||
actual_state = State::ForwardToRamp;
|
||||
|
@ -118,7 +122,7 @@ void loop()
|
|||
|
||||
case State::ForwardToRamp:
|
||||
my_IO.motorControlOn();
|
||||
my_IO.setSpeed(2048.0f);
|
||||
my_IO.setSpeed(NORMAL_SPEED);
|
||||
|
||||
if(my_IO.getAngle(Axes::Y) < -5.0f)
|
||||
{
|
||||
|
@ -127,10 +131,9 @@ void loop()
|
|||
break;
|
||||
|
||||
case State::ForwardToScene:
|
||||
my_IO.setSpeed(2048.0f);
|
||||
|
||||
if(my_IO.getAngle(Axes::Y) > -5.0f)
|
||||
{
|
||||
my_IO.setSpeed(ON_STAGE_SPEED);
|
||||
actual_state = my_IO.isSelectedColorBlue() ? State::Turn90Blue : State::Turn90Yellow;
|
||||
//actual_state = State::Dancing;
|
||||
}
|
||||
|
@ -155,7 +158,7 @@ void loop()
|
|||
break;
|
||||
|
||||
case State::ForwardToSceneEdge:
|
||||
my_IO.setSpeed(1200.0f);
|
||||
my_IO.setSpeed(ON_STAGE_SPEED);
|
||||
|
||||
if(my_IO.getAngle(Axes::Y) > 5.0f)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue