Edit comments
authorShivani Ghanta <shivani.oghanta@gmail.com>
Wed, 18 Jan 2017 02:52:15 +0000 (18:52 -0800)
committerShivani Ghanta <shivani.oghanta@gmail.com>
Sat, 21 Jan 2017 22:27:37 +0000 (14:27 -0800)
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinch.java
src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java
src/org/usfirst/frc/team3501/robot/subsystems/Climber.java

index f9057302df9396e7a9dbb004e20e49496ae34412..e72c0284b52d3f65336496174716c26c02fb18aa 100644 (file)
@@ -1,6 +1,8 @@
 package org.usfirst.frc.team3501.robot;
 
 import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.Button;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
 
 public class OI {
   private static OI oi;
@@ -11,7 +13,8 @@ public class OI {
   public OI() {
     leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
     rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
-    Â toggleWinch = new JoystickButton(leftJoystick,Constants.OI.TOGGLE_WINCH_PORT);
+    toggleWinch = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_WINCH_PORT);
 
   }
 
index ba8b20160635cbbc59ebd81a7975684d009f7438..d6d047c98f53671e57a77ea9405c0961e0c49a65 100644 (file)
@@ -7,8 +7,12 @@ import com.sun.glass.ui.Timer;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
- * Runs the winch for a given time and motor value
+ * This command runs the winch for a given motor value and time in seconds
  *
+ * @param motorVal
+ *          value range is from -1 to 1
+ * @param time
+ *          in seconds
  * @author shivanighanta
  *
  */
index dc29866a2e4892cd6ba49491e1afcd81fdd3de9d..c15ca1047c16f1697cebfca04fc0abaf7432c89d 100644 (file)
@@ -5,7 +5,8 @@ import org.usfirst.frc.team3501.robot.Robot;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
- * Runs the winch continuously at a given motor value
+ * This command will run the winch motor continuously until the button
+ * triggering it is released
  *
  * @author shivanighanta
  *
@@ -30,7 +31,7 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected boolean isFinished() {
-    return false;
+    return !Robot.getOI().toggleWinch.get();
   }
 
   @Override
index 3426dad718b70fce7772c37871d39bbed8647de6..9dd7361ba83d3b2da383834f0150aa86696ca345 100644 (file)
@@ -15,10 +15,10 @@ public class Climber {
   }
 
   public void stop() {
-    setMotorValues(0);
+    setMotorValue(0);
   }
 
-  public void setMotorValues(final double val) {
+  public void setMotorValue(final double val) {
 
   }
 }