public static class Scaler {
// Piston channels
public final static int FORWARD_CHANNEL = 0;
- public final static int REVERSE_CHANNEL = 0;
+ public final static int REVERSE_CHANNEL = 1;
// Winch port
public final static int WINCH_MOTOR = 0;
// Winch speeds
- public final static double WINCH_STOP_SPEED = 00;
+ public final static double WINCH_STOP_SPEED = 0.0;
}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.scaler;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class StopWinch extends Command {
+
+ @Override
+ protected void initialize() {
+ Robot.scaler.stopWinch();
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+
+}
import edu.wpi.first.wpilibj.command.Subsystem;
public class Scaler extends Subsystem {
- private DoubleSolenoid piston;
+ private DoubleSolenoid scaler;
private CANTalon winch;
public Scaler() {
- piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL,
+ scaler = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL,
Constants.Scaler.REVERSE_CHANNEL);
winch = new CANTalon(Constants.Scaler.WINCH_MOTOR);
}
public Value getSolenoidValue() {
- return piston.get();
+ return scaler.get();
}
public void liftScissorLift() {
- piston.set(DoubleSolenoid.Value.kReverse);
+ scaler.set(DoubleSolenoid.Value.kReverse);
}
public void lowerScissorLift() {
- piston.set(DoubleSolenoid.Value.kForward);
- }
-
- public void engageHook() {
-
- }
-
- public void disengageHook() {
+ scaler.set(DoubleSolenoid.Value.kForward);
}
public void runWinch(double speed) {
runWinch(Constants.Scaler.WINCH_STOP_SPEED);
}
- /***
- * This method returns boolean value true or false on whether piston is
- * extended or not.
- *
- * @return returns true if piston is extended, false if otherwise.
- */
- public boolean getPistonStatus() {
- return true;
- }
-
- /***
- * This method sets the piston status for the scissor lift. The piston can
- * either be extended or not extended.
- *
- * @param status
- * The status of the piston. 0 for the piston to be extended, 1 for
- * the piston to not be extended.
- */
-
- public void setPistonStatus(int status) {
-
- }
-
@Override
protected void initDefaultCommand() {