Finish implementing ReverseIndexWheel
authorShivani Ghanta <shivani.oghanta@gmail.com>
Fri, 3 Feb 2017 05:14:30 +0000 (21:14 -0800)
committerCindy Zhang <cindyzyx9@gmail.com>
Sat, 4 Feb 2017 19:08:55 +0000 (11:08 -0800)
src/org/usfirst/frc/team3501/robot/commands/shooter/ReverseIndexWheel.java

index 4c745159b404f53c04a2a47c2866559aecd0fbb3..544a81533158ec247845a4fb5c81869d1938fa38 100644 (file)
@@ -2,7 +2,6 @@ package org.usfirst.frc.team3501.robot.commands.shooter;
 
 import org.usfirst.frc.team3501.robot.Robot;
 
-import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
@@ -13,7 +12,6 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 
 public class ReverseIndexWheel extends Command {
-  Timer timer;
   private double time;
   private double motorVal;
 
@@ -28,14 +26,12 @@ public class ReverseIndexWheel extends Command {
 
   public ReverseIndexWheel(double time, double motorVal) {
     requires(Robot.getDriveTrain());
-    timer = new Timer();
     this.time = time;
     this.motorVal = motorVal;
   }
 
   @Override
   protected void initialize() {
-    timer.start();
 
   }
 
@@ -47,7 +43,7 @@ public class ReverseIndexWheel extends Command {
 
   @Override
   protected boolean isFinished() {
-    return timer.get() >= time;
+    return timeSinceInitialized() >= time;
   }
 
   @Override