Skip to content

Commit

Permalink
Fixed bug Wrong Repair,Yellow and Red card detection
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoCunha committed Feb 3, 2020
1 parent 4227c98 commit ce5a068
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions mslrb2015/StateMachine.pde
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ static class StateMachine
else if(btnCurrent.isRed())
{
if(btnCurrent.isLeft())
teamA.newRedCard=btnOn;
teamA.newRedCard=btnOn;
else
teamB.newRedCard=btnOn;
teamB.newRedCard=btnOn;
}
else if(btnCurrent.isYellow())
{
Expand All @@ -282,9 +282,9 @@ static class StateMachine
t = teamB;

if (t.YellowCardCount==1)
t.newDoubleYellow = btnOn;
t.newDoubleYellow = btnOn;
else
t.newYellowCard = btnOn;
t.newYellowCard = btnOn;
}
else if(btnCurrent.isStop())
{
Expand Down
2 changes: 1 addition & 1 deletion mslrb2015/enums.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public boolean isCommon()
//******************************************************************************************************
public boolean isLeft()
{
return value >= BTN_L_KICKOFF.value && value <= BTN_L_ISALIVE.value;
return value >= BTN_L_KICKOFF.value && value <= BTN_L_YELLOW.value;
}

//******************************************************************************************************
Expand Down

0 comments on commit ce5a068

Please sign in to comment.