We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab167b6 commit 195fa22Copy full SHA for 195fa22
out/leJOS-RobotPilot.jar
20 Bytes
src/robotpilot/RobotPilot.java
@@ -322,11 +322,12 @@ public void close() {
322
323
public void setSpeed(float speed) {
324
// Sets the speed of the robot
325
- this.speed = speed;
326
- synchronizeMotors();
327
- motor1.setSpeed(speed);
328
- motor2.setSpeed(speed);
329
- motor1.endSynchronization();
+ stop();
+ this.speed = speed;
+ synchronizeMotors();
+ motor1.setSpeed(speed);
+ motor2.setSpeed(speed);
330
+ motor1.endSynchronization();
331
332
}
333
0 commit comments