add Motor value in constants
authorShivani Ghanta <shivani.oghanta@gmail.com>
Wed, 18 Jan 2017 03:59:52 +0000 (19:59 -0800)
committerArunima DIvya <adivya822@student.fuhsd.org>
Thu, 26 Jan 2017 04:21:14 +0000 (20:21 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java
src/org/usfirst/frc/team3501/robot/subsystems/Climber.java [new file with mode: 0644]

index df33dfc4adb3c6f906ff5483b2da44258027dac8..8fcc2615d8cd64a7554fe02c7b1daaec043485be 100644 (file)
@@ -21,6 +21,7 @@ public class Constants {
     public static final int INDEX_WHEEL = 0;
     public final static int TOGGLE_FLYWHEEL_PORT = 0;
     public final static int TOGGLE_INDEXWHEEL_PORT = 0;
+
   }
 
   public static class DriveTrain {
index 42f439b0390bf21e5cdba30920d2eb607c176a8d..2c99adc7bd4aa2185aa87fab3fb31b64546bf35b 100644 (file)
@@ -13,7 +13,11 @@ import edu.wpi.first.wpilibj.command.Command;
 public class StopWinch extends Command {
 
   public StopWinch() {
+<<<<<<< HEAD
     requires(Robot.getDriveTrain());
+=======
+    requires(Robot.getClimber());
+>>>>>>> add Motor value in constants
 
   }
 
diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java
new file mode 100644 (file)
index 0000000..3d49f90
--- /dev/null
@@ -0,0 +1,32 @@
+package org.usfirst.frc.team3501.robot.subsystems;
+
+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() {
+    if (climber == null) {
+      climber = new Climber();
+    }
+    return climber;
+  }
+
+  public void stop() {
+    setMotorValue(0);
+  }
+
+  public void setMotorValue(final double val) {
+    motor.set(MOTOR);
+
+  }
+}