Skip to content

Commit af2e430

Browse files
committed
Fixed bug when robot didn't wait
1 parent c6d0215 commit af2e430

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/robotpilot/RobotPilot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,11 @@ public boolean isMoving() {
492492

493493
public void waitComplete() {
494494
// Waits until the motors stop moving/rotating
495-
startSynchronization();
496495
motor1.waitComplete();
497496
motor2.waitComplete();
498-
motor1.endSynchronization();
497+
if (motor1.isMoving()) {
498+
motor1.waitComplete();
499+
}
499500
}
500501

501502
public void rotateLeftMotorTo(int angle) {

0 commit comments

Comments
 (0)