From: Shivani Ghanta Date: Wed, 18 Jan 2017 03:59:52 +0000 (-0800) Subject: add Motor value in constants X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=7b3f27ebc4101105e1d54e1f7ae2f6e3f42fa2a8 add Motor value in constants --- 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); + + } +}