Skip to content
This repository has been archived by the owner on Mar 3, 2019. It is now read-only.

Commit

Permalink
Funny action à la fin du MatchChrono, dans le LL
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvaing19 committed May 24, 2017
1 parent 0a7f042 commit e21d1a9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions teensy/loli_teensy/OrderLong.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,22 @@ class StartMatchChrono : public OrderLong, public Singleton<StartMatchChrono>
{
Serial.println("Start match chrono");
beginTime = millis();
matchFinished = false;
}
void onExecute(std::vector<uint8_t> & output)
{
if (millis() - beginTime > 90000)
if (millis() - beginTime > 90000 && !matchFinished)
{
returnStatement = 0x00; // MATCH_FINISHED
finished = true;
matchFinished = true;
actuatorMgr.funnyAction(true);
}
else if (matchFinished)
{
if (actuatorMgr.funnyAction(false) != RUNNING)
{
finished = true;
returnStatement = 0x00; // MATCH + FUNNY_ACTION FINISHED
}
}
}
void terminate(std::vector<uint8_t> & output)
Expand All @@ -248,6 +257,7 @@ class StartMatchChrono : public OrderLong, public Singleton<StartMatchChrono>
private:
uint32_t beginTime;
uint8_t returnStatement;
bool matchFinished;
};


Expand Down

0 comments on commit e21d1a9

Please sign in to comment.