move code in execute() to initilize()
authorMeryem Esa <meresa14@gmail.com>
Fri, 5 Feb 2016 02:39:47 +0000 (18:39 -0800)
committerMeryem Esa <meresa14@gmail.com>
Mon, 15 Feb 2016 01:01:23 +0000 (17:01 -0800)
src/org/usfirst/frc/team3501/robot/commands/driving/TurnForTime.java

index 82dff37237ebbecd43458157343dbf16748c43bf..7a27e7bc5d8cf28504f9d4447c7a843295d26a66 100755 (executable)
@@ -8,7 +8,7 @@ import edu.wpi.first.wpilibj.command.Command;
 
 /***
  * This command turns the robot in a specified direction for a specified
- * duration.
+ * duration in seconds.
  *
  * pre-condition: robot is on a flat surface
  *
@@ -34,10 +34,7 @@ public class TurnForTime extends Command {
   protected void initialize() {
     timer = new Timer();
     timer.start();
-  }
 
-  @Override
-  protected void execute() {
     if (direction == Direction.RIGHT) {
       Robot.driveTrain.setMotorSpeeds(SPEED, -SPEED);
     } else if (direction == Direction.LEFT) {
@@ -45,6 +42,11 @@ public class TurnForTime extends Command {
     }
   }
 
+  @Override
+  protected void execute() {
+
+  }
+
   @Override
   protected boolean isFinished() {
     if (timer.get() >= seconds)