-package org.usfirst.frc.team3501.robot.subsystems;\r
-import org.usfirst.frc.team3501.robot.Constants;\r
-\r
-import edu.wpi.first.wpilibj.DoubleSolenoid;\r
-import edu.wpi.first.wpilibj.DoubleSolenoid.Value;\r
-import edu.wpi.first.wpilibj.command.Subsystem;\r
-\r
-public class Scaler extends Subsystem {\r
- //Scaler related objects\r
- private DoubleSolenoid piston;\r
- \r
- \r
- public Scaler() {\r
- piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, Constants.Scaler.REVERSE_CHANNEL);\r
- }\r
-\r
- @Override\r
- protected void initDefaultCommand() {\r
-\r
- }\r
- public Value getSolenoidValue(){\r
- return piston.get();\r
- }\r
- \r
- public void lift(){\r
- piston.set(DoubleSolenoid.Value.kReverse);\r
- }\r
- \r
- public void lower(){\r
- piston.set(DoubleSolenoid.Value.kForward);\r
- }\r
- \r
- public void disengageHook(){\r
- \r
- }\r
- \r
- public void runWinch(){\r
- \r
- }\r
- \r
-}\r
+package org.usfirst.frc.team3501.robot.subsystems;
+
+import org.usfirst.frc.team3501.robot.Constants;
+
+import edu.wpi.first.wpilibj.CANTalon;
+import edu.wpi.first.wpilibj.DoubleSolenoid;
+import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+public class Scaler extends Subsystem {
+ private DoubleSolenoid piston;
+ private CANTalon winch;
+
+ public Scaler() {
+ piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL,
+ Constants.Scaler.REVERSE_CHANNEL);
+ winch = new CANTalon(Constants.Scaler.WINCH_MOTOR);
+ }
+
+ public Value getSolenoidValue() {
+ return piston.get();
+ }
+
+ public void liftScissorLift() {
+ piston.set(DoubleSolenoid.Value.kReverse);
+ }
+
+ public void lowerScissorLift() {
+ piston.set(DoubleSolenoid.Value.kForward);
+ }
+
+ public void engageHook() {
+
+ }
+
+ public void disengageHook() {
+ }
+
+ public void runWinch(double speed) {
+ if (speed > 1)
+ speed = 1;
+ if (speed < -1)
+ speed = -1;
+
+ winch.set(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 motor voltage for the scissor lift. The range is from
+ * [-1, 1].
+ *
+ * @param speed
+ * The voltage that you set the motor at. The range of the voltage of
+ * the motor is from [-1,1].
+ */
+ public void setScalarSpeed(double speed) {
+
+ }
+
+ /***
+ * 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() {
+
+ }
+}