From 7b3f27ebc4101105e1d54e1f7ae2f6e3f42fa2a8 Mon Sep 17 00:00:00 2001 From: Shivani Ghanta Date: Tue, 17 Jan 2017 19:59:52 -0800 Subject: [PATCH] add Motor value in constants --- .../usfirst/frc/team3501/robot/Constants.java | 1 + .../robot/commands/climber/StopWinch.java | 4 +++ .../team3501/robot/subsystems/Climber.java | 32 +++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/org/usfirst/frc/team3501/robot/subsystems/Climber.java diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index df33dfc..8fcc261 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -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 { diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java index 42f439b..2c99adc 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/StopWinch.java @@ -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 index 0000000..3d49f90 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Climber.java @@ -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); + + } +} -- 2.30.2