Skip to content

Commit 195fa22

Browse files
committed
Minimalized the bug where the robot started moving too quickly.
1 parent ab167b6 commit 195fa22

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

out/leJOS-RobotPilot.jar

20 Bytes
Binary file not shown.

src/robotpilot/RobotPilot.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,12 @@ public void close() {
322322

323323
public void setSpeed(float speed) {
324324
// Sets the speed of the robot
325-
this.speed = speed;
326-
synchronizeMotors();
327-
motor1.setSpeed(speed);
328-
motor2.setSpeed(speed);
329-
motor1.endSynchronization();
325+
stop();
326+
this.speed = speed;
327+
synchronizeMotors();
328+
motor1.setSpeed(speed);
329+
motor2.setSpeed(speed);
330+
motor1.endSynchronization();
330331

331332
}
332333

0 commit comments

Comments
 (0)