add Motor value in constants
authorShivani Ghanta <shivani.oghanta@gmail.com>
Wed, 18 Jan 2017 03:59:52 +0000 (19:59 -0800)
committerShivani Ghanta <shivani.oghanta@gmail.com>
Sat, 21 Jan 2017 22:27:37 +0000 (14:27 -0800)
src/org/usfirst/frc/team3501/robot/Constants.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/commands/climber/StopWinch.java
src/org/usfirst/frc/team3501/robot/subsystems/Climber.java

index a3e3e429dd76482b2cbb4610f570d0ffec86b9d3..911bfdca53cc26cadb60b87c6069050331cdcb69 100644 (file)
@@ -10,7 +10,7 @@ public class Constants {
   public static class OI {
     public final static int LEFT_STICK_PORT = 0;
     public final static int RIGHT_STICK_PORT = 1;
-    public final static int  TOGGLE_WINCH_PORT = 0;
+    public final static int TOGGLE_WINCH_PORT = 0;
   }
 
   public static class DriveTrain {
@@ -27,6 +27,12 @@ public class Constants {
     public static final int ENCODER_RIGHT_B = 3;
   }
 
+  public static class Climber {
+    // MOTOR CONTROLLERS
+    public static final int MOTOR_VAL = 1;
+
+  }
+
   public static enum Direction {
     LEFT, RIGHT, DOWN, UP, FORWARD, BACKWARD;
   }
index 54df317ea3d7a88b2b82356db9205b4a2eb279f2..eda932a5467996a08fdc46d98f49eb786f73c613 100644 (file)
@@ -2,8 +2,7 @@ package org.usfirst.frc.team3501.robot.commands.climber;
 
 import org.usfirst.frc.team3501.robot.Robot;
 
-import com.sun.glass.ui.Timer;
-
+import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
index bb2a74e8398aeefc7a2a104a01822af6197b1967..eef39671914b5a5cc71288d14c9f34d797b5d272 100644 (file)
@@ -23,6 +23,7 @@ public class RunWinchContinuous extends Command {
   private double motorVal;
 
   public RunWinchContinuous(double motorVal) {
+    requires(Robot.getClimber());
     this.motorVal = motorVal;
   }
 
index 903f22b94488c57bb6bdee942894ef6f4b40e084..892d2ddfb2c726a90814d39bc7c0b2c00a1ba344 100644 (file)
@@ -15,6 +15,8 @@ import edu.wpi.first.wpilibj.command.Command;
 public class StopWinch extends Command {
 
   public StopWinch() {
+    requires(Robot.getClimber());
+
   }
 
   @Override
index 9dd7361ba83d3b2da383834f0150aa86696ca345..3d49f90be48f17f96ef93f6a4c550030697265a2 100644 (file)
@@ -1,10 +1,17 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
-public class Climber {
+import org.usfirst.frc.team3501.robot.Constants;
+
+import com.ctre.CANTalon;
+
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+public class Climber extends Subsystem {
   private static Climber climber;
+  private final CANTalon motor;
 
   private Climber() {
-
+    motor = new CANTalon(Constants.Climber.MOTOR);
   }
 
   public static Climber getClimber() {
@@ -19,6 +26,7 @@ public class Climber {
   }
 
   public void setMotorValue(final double val) {
+    motor.set(MOTOR);
 
   }
 }