From 804d3b6a139821df41db07e5cd2c513355ac7547 Mon Sep 17 00:00:00 2001 From: Kaitlyn Date: Fri, 29 Jan 2016 19:20:31 -0800 Subject: [PATCH] create methods for Scaler subsystem --- .../usfirst/frc/team3501/robot/Constants.java | 6 ++++ .../frc/team3501/robot/subsystems/Scaler.java | 30 +++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index f5694c6f..0cd7a7e9 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -32,6 +32,12 @@ public class Constants { public final static int ENCODER_RIGHT_A = 2; public final static int ENCODER_RIGHT_B = 1; } + + public static class Scaler { + //Piston channels + public final static int FORWARD_CHANNEL = 0; + public final static int REVERSE_CHANNEL = 0; + } public static class Shooter { public static final int PORT = 0; diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java index 183166cf..97c2e955 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java @@ -1,15 +1,41 @@ package org.usfirst.frc.team3501.robot.subsystems; +import org.usfirst.frc.team3501.robot.Constants; +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 { - + //Scaler related objects + private DoubleSolenoid piston; + + public Scaler() { - + piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL, Constants.Scaler.REVERSE_CHANNEL); } @Override protected void initDefaultCommand() { } + public Value getSolenoidValue(){ + return piston.get(); + } + + public void lift(){ + piston.set(DoubleSolenoid.Value.kReverse); + } + + public void lower(){ + piston.set(DoubleSolenoid.Value.kForward); + } + + public void disengageHook(){ + + } + + public void runWinch(){ + + } + } -- 2.30.2