Skip to content

Commit

Permalink
Fix minor bug in track recoil functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenPanzerProject committed Jan 27, 2020
1 parent d884c81 commit afcf9b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion OpenPanzerTCB/OpenPanzerTCB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,8 @@ if (Startup)
if (DriveModeActual == TRACK_RECOIL && DriveSpeed == 0)
{
DriveModeActual = STOP;
RightSpeed_Previous = 0; // Force treads to update for next round
LeftSpeed_Previous = 0;
}
}
else
Expand Down Expand Up @@ -1067,7 +1069,7 @@ if (Startup)

//Finally! We send the motor commands out to the motors, but only if something has changed since last time.
if ((RightSpeed_Previous != RightSpeed) || (LeftSpeed_Previous != LeftSpeed))
{
{
RightTread->setSpeed(RightSpeed);
LeftTread->setSpeed(LeftSpeed);
RightSpeed_Previous = RightSpeed; // Save these for next time
Expand Down

0 comments on commit afcf9b1

Please sign in to comment.