diff --git a/build/jars/NetworkTables.jar b/build/jars/NetworkTables.jar new file mode 100644 index 0000000..3b578a3 Binary files /dev/null and b/build/jars/NetworkTables.jar differ diff --git a/build/jars/WPILib.jar b/build/jars/WPILib.jar new file mode 100644 index 0000000..fa955eb Binary files /dev/null and b/build/jars/WPILib.jar differ diff --git a/build/jars/cscore.jar b/build/jars/cscore.jar new file mode 100644 index 0000000..7b95664 Binary files /dev/null and b/build/jars/cscore.jar differ diff --git a/build/jars/navx_frc.jar b/build/jars/navx_frc.jar new file mode 100644 index 0000000..7d87d72 Binary files /dev/null and b/build/jars/navx_frc.jar differ diff --git a/build/jars/opencv.jar b/build/jars/opencv.jar new file mode 100644 index 0000000..5edacd2 Binary files /dev/null and b/build/jars/opencv.jar differ diff --git a/build/org/usfirst/frc/team5401/robot/OI.class b/build/org/usfirst/frc/team5401/robot/OI.class index f3f826c..2c2fcb8 100644 Binary files a/build/org/usfirst/frc/team5401/robot/OI.class and b/build/org/usfirst/frc/team5401/robot/OI.class differ diff --git a/build/org/usfirst/frc/team5401/robot/Robot.class b/build/org/usfirst/frc/team5401/robot/Robot.class index 2cf7fcf..7412017 100644 Binary files a/build/org/usfirst/frc/team5401/robot/Robot.class and b/build/org/usfirst/frc/team5401/robot/Robot.class differ diff --git a/build/org/usfirst/frc/team5401/robot/RobotMap.class b/build/org/usfirst/frc/team5401/robot/RobotMap.class index b976b1a..7c3748c 100644 Binary files a/build/org/usfirst/frc/team5401/robot/RobotMap.class and b/build/org/usfirst/frc/team5401/robot/RobotMap.class differ diff --git a/build/org/usfirst/frc/team5401/robot/commands/xboxMove.class b/build/org/usfirst/frc/team5401/robot/commands/xboxMove.class new file mode 100644 index 0000000..ea65053 Binary files /dev/null and b/build/org/usfirst/frc/team5401/robot/commands/xboxMove.class differ diff --git a/build/org/usfirst/frc/team5401/robot/subsystems/DriveBase.class b/build/org/usfirst/frc/team5401/robot/subsystems/DriveBase.class index 680156c..bccd414 100644 Binary files a/build/org/usfirst/frc/team5401/robot/subsystems/DriveBase.class and b/build/org/usfirst/frc/team5401/robot/subsystems/DriveBase.class differ diff --git a/dist/FRCUserProgram.jar b/dist/FRCUserProgram.jar new file mode 100644 index 0000000..ed70690 Binary files /dev/null and b/dist/FRCUserProgram.jar differ diff --git a/src/org/usfirst/frc/team5401/robot/OI.java b/src/org/usfirst/frc/team5401/robot/OI.java index 54b5ebf..c417fd1 100644 --- a/src/org/usfirst/frc/team5401/robot/OI.java +++ b/src/org/usfirst/frc/team5401/robot/OI.java @@ -92,6 +92,8 @@ public OI(){ // operatorY.whenPressed(new Climb(1)); // operatorY.whenReleased(new Climb(0)); + //Xbox Move Override + driverX.whenPressed(new xboxMove()); } diff --git a/src/org/usfirst/frc/team5401/robot/Robot.java b/src/org/usfirst/frc/team5401/robot/Robot.java index 39d8848..b049581 100644 --- a/src/org/usfirst/frc/team5401/robot/Robot.java +++ b/src/org/usfirst/frc/team5401/robot/Robot.java @@ -8,6 +8,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import org.usfirst.frc.team5401.robot.commands.xboxMove; import org.usfirst.frc.team5401.robot.subsystems.*; /** @@ -47,7 +48,7 @@ public void robotInit() { oi = new OI(); // chooser.addObject("My Auto", new MyAutoCommand()); - SmartDashboard.putData("Auto mode", chooser); + chooser = new SendableChooser(); } /** @@ -108,6 +109,7 @@ public void teleopInit() { // this line or comment it out. if (autonomousCommand != null) autonomousCommand.cancel(); + Scheduler.getInstance().add(new xboxMove()); } /** diff --git a/src/org/usfirst/frc/team5401/robot/RobotMap.java b/src/org/usfirst/frc/team5401/robot/RobotMap.java index 732779f..ea5417d 100644 --- a/src/org/usfirst/frc/team5401/robot/RobotMap.java +++ b/src/org/usfirst/frc/team5401/robot/RobotMap.java @@ -35,8 +35,8 @@ public class RobotMap { //PWM Motors public static final int LEFT_DRIVE_MOTOR_1 = 0; public static final int RIGHT_DRIVE_MOTOR_1 = 1; - public static final int LEFT_DRIVE_MOTOR_2 = 3; - public static final int RIGHT_DRIVE_MOTOR_2 = 4; + public static final int LEFT_DRIVE_MOTOR_2 = 7; + public static final int RIGHT_DRIVE_MOTOR_2 = 8; public static final int INFEEDER_BAR = 5; public static final int CLIMBER_MOTOR = 6; diff --git a/src/org/usfirst/frc/team5401/robot/commands/Climb.java b/src/org/usfirst/frc/team5401/robot/commands/Climb.java deleted file mode 100644 index ca66237..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/Climb.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import org.usfirst.frc.team5401.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * - */ -public class Climb extends Command { - - private int input; - - public Climb(int direction) { - requires(Robot.climber); - input = direction; - } - - // Called just before this Command runs the first time - protected void initialize() { - if (input == 1){ - Robot.climber.climbUp(); - } - else if (input == 0){ - Robot.climber.climbStop(); - } - - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - Robot.climber.climbStop(); - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/PopGear.java b/src/org/usfirst/frc/team5401/robot/commands/PopGear.java deleted file mode 100644 index 54df409..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/PopGear.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import edu.wpi.first.wpilibj.command.Command; -import org.usfirst.frc.team5401.robot.Robot; -/** - * - */ -public class PopGear extends Command { - - public PopGear() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.gearMechanism); - } - - // Called just before this Command runs the first time - protected void initialize() { - Robot.gearMechanism.openDoor(); - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - Robot.gearMechanism.closeDoor(); - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - Robot.gearMechanism.closeDoor(); - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/feederArmUpDown.java b/src/org/usfirst/frc/team5401/robot/commands/feederArmUpDown.java deleted file mode 100644 index 02b481f..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/feederArmUpDown.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import org.usfirst.frc.team5401.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * - */ -public class feederArmUpDown extends Command { - - private int upDown; - - public feederArmUpDown(int armDirection) { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.infeed); - - upDown = armDirection; - } - - // Called just before this Command runs the first time - protected void initialize() { - Robot.infeed.armUpDown(upDown); - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/feederControl.java b/src/org/usfirst/frc/team5401/robot/commands/feederControl.java deleted file mode 100644 index 23de377..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/feederControl.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import org.usfirst.frc.team5401.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * - */ -public class feederControl extends Command { - - private int upDown; - private int inOut; - - public feederControl() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.infeed); - } - - // Called just before this Command runs the first time - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - upDown = Robot.oi.getXboxLeftY_Operator(); - inOut = Robot.oi.getTriggers_Operator(); - - Robot.infeed.armUpDown(upDown); - Robot.infeed.feedDirection(inOut); - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return false; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/feederInOut.java b/src/org/usfirst/frc/team5401/robot/commands/feederInOut.java deleted file mode 100644 index 713950c..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/feederInOut.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import org.usfirst.frc.team5401.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * - */ -public class feederInOut extends Command { - - private int feederDirection; - - public feederInOut(int feedDirection) { - requires(Robot.infeed); - feederDirection = feedDirection; - } - - // Called just before this Command runs the first time - protected void initialize() { - Robot.infeed.feedDirection(feederDirection); - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/loadShooter.java b/src/org/usfirst/frc/team5401/robot/commands/loadShooter.java deleted file mode 100644 index b5a1b18..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/loadShooter.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import edu.wpi.first.wpilibj.command.Command; - -import org.usfirst.frc.team5401.robot.Robot; -import org.usfirst.frc.team5401.robot.RobotMap; -import org.usfirst.frc.team5401.robot.subsystems.Loader; - -/** - * - */ -public class loadShooter extends Command { - - public loadShooter() { - // Use requires() here to declare subsystem dependencies - requires(Robot.loader); - } - - // Called just before this Command runs the first time - protected void initialize() { - Robot.loader.switchState(); - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - Robot.loader.stopLoader(); - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/toggleCompressor.java b/src/org/usfirst/frc/team5401/robot/commands/toggleCompressor.java deleted file mode 100644 index 1249434..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/toggleCompressor.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import edu.wpi.first.wpilibj.command.Command; -import org.usfirst.frc.team5401.robot.Robot; - -/** - * - */ -public class toggleCompressor extends Command { - - public toggleCompressor() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.compressorsubsystem); - } - - // Called just before this Command runs the first time - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - Robot.compressorsubsystem.switchState(); - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - Robot.compressorsubsystem.stopCompressor(); - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/unjamIn.java b/src/org/usfirst/frc/team5401/robot/commands/unjamIn.java deleted file mode 100644 index 685c958..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/unjamIn.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import edu.wpi.first.wpilibj.command.Command; -import org.usfirst.frc.team5401.robot.Robot; - -/** - * - */ -public class unjamIn extends Command { - - public unjamIn() { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.unjammer); - } - - // Called just before this Command runs the first time - protected void initialize() { - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - Robot.unjammer.unjamIn(); - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } -} diff --git a/src/org/usfirst/frc/team5401/robot/commands/unjamToggle.java b/src/org/usfirst/frc/team5401/robot/commands/unjamToggle.java deleted file mode 100644 index f57f6c1..0000000 --- a/src/org/usfirst/frc/team5401/robot/commands/unjamToggle.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.usfirst.frc.team5401.robot.commands; - -import org.usfirst.frc.team5401.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * - */ -public class unjamToggle extends Command { - - private int input; - - public unjamToggle(int direction) { - // Use requires() here to declare subsystem dependencies - // eg. requires(chassis); - requires(Robot.unjammer); - input = direction; - } - - // Called just before this Command runs the first time - protected void initialize() { - if(input == 1){ - Robot.unjammer.unjamIn(); - } - else if(input == -1){ - Robot.unjammer.unjamOut(); - } - } - - // Called repeatedly when this Command is scheduled to run - protected void execute() { - } - - // Make this return true when this Command no longer needs to run execute() - protected boolean isFinished() { - return true; - } - - // Called once after isFinished returns true - protected void end() { - } - - // Called when another command which requires one or more of the same - // subsystems is scheduled to run - protected void interrupted() { - } -} diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/Climber.java b/src/org/usfirst/frc/team5401/robot/subsystems/Climber.java deleted file mode 100644 index a6bf95c..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/Climber.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; - -import org.usfirst.frc.team5401.robot.RobotMap; - -import edu.wpi.first.wpilibj.VictorSP; - -/** - * - */ -public class Climber extends Subsystem { - - private VictorSP climbMotor; - - private double SPEED; - - public Climber(){ - climbMotor = new VictorSP(RobotMap.CLIMBER_MOTOR); - - SPEED = .9; - } - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } - - public void climbUp(){ - climbMotor.set(SPEED); - } - - public void climbStop(){ - climbMotor.set(0); - } -} - diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/CompressorSubsystem.java b/src/org/usfirst/frc/team5401/robot/subsystems/CompressorSubsystem.java deleted file mode 100644 index f024109..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/CompressorSubsystem.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; - -import org.usfirst.frc.team5401.robot.RobotMap; - -import edu.wpi.first.wpilibj.Compressor; - -/** - * - */ -public class CompressorSubsystem extends Subsystem { - - private Compressor compressor; - - public CompressorSubsystem(){ - compressor = new Compressor(RobotMap.PCM_ID); - } - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } - - public void startCompressor(){ - compressor.setClosedLoopControl(true); - compressor.start(); - } - - public void stopCompressor(){ - compressor.stop(); - } - - public boolean isEnabled(){ - return compressor.enabled(); - } - - public void switchState(){ - if(isEnabled()){ - stopCompressor(); - } - - else { - startCompressor(); - } - } -} - diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/DriveBase.java b/src/org/usfirst/frc/team5401/robot/subsystems/DriveBase.java index 7fc0af7..c25471c 100644 --- a/src/org/usfirst/frc/team5401/robot/subsystems/DriveBase.java +++ b/src/org/usfirst/frc/team5401/robot/subsystems/DriveBase.java @@ -19,7 +19,6 @@ public class DriveBase extends Subsystem { double LOW_GEAR_RIGHT_DPP; double HIGH_GEAR_LEFT_DPP; double HIGH_GEAR_RIGHT_DPP; - double GYRO_OFFSET; // Put methods for controlling this subsystem // here. Call these from Commands. @@ -51,6 +50,11 @@ public DriveBase(){ // gyro.reset(); } + + public void initDefaultCommand() { + // Set the default command for a subsystem here. + //setDefaultCommand(new MySpecialCommand()); + } public void drive(double leftDriveDesired, double rightDriveDesired){ leftDrive1.set(leftDriveDesired); rightDrive1.set(-1* rightDriveDesired); @@ -113,9 +117,5 @@ public void resetEncoders(){ return currentAngle; } */ - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } } diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/ExampleSubsystem.java b/src/org/usfirst/frc/team5401/robot/subsystems/ExampleSubsystem.java deleted file mode 100644 index 1b1fc05..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/ExampleSubsystem.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; - -/** - * - */ -public class ExampleSubsystem extends Subsystem { - // Put methods for controlling this subsystem - // here. Call these from Commands. - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - // setDefaultCommand(new MySpecialCommand()); - } -} diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/GearMechanism.java b/src/org/usfirst/frc/team5401/robot/subsystems/GearMechanism.java deleted file mode 100644 index 873e5fa..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/GearMechanism.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; -import edu.wpi.first.wpilibj.DoubleSolenoid; -import org.usfirst.frc.team5401.robot.RobotMap; -//import org.usfirst.frc.team5401.robot.commands.PopGear; - -/** - * - */ -public class GearMechanism extends Subsystem { - - private DoubleSolenoid gearPop; - - private boolean enabled; - - public GearMechanism(){ - gearPop = new DoubleSolenoid(RobotMap.PCM_ID, RobotMap.GEAR_DOOR_CLOSE, RobotMap.GEAR_DOOR_OPEN); - } - - // Put methods for controlling this subsystem - // here. Call these from Commands. - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); -// setDefaultCommand(new PopGear()); - } - - public void openDoor(){ - enabled = true; - gearPop.set(DoubleSolenoid.Value.kForward); - } - public void closeDoor(){ - enabled = false; - gearPop.set(DoubleSolenoid.Value.kReverse); - } - -} - diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/Infeed.java b/src/org/usfirst/frc/team5401/robot/subsystems/Infeed.java deleted file mode 100644 index f90da20..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/Infeed.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; -import edu.wpi.first.wpilibj.AnalogInput; -import edu.wpi.first.wpilibj.DoubleSolenoid; -import edu.wpi.first.wpilibj.VictorSP; - -import org.usfirst.frc.team5401.robot.RobotMap; -//import org.usfirst.frc.team5401.robot.commands.feederControl; - -/** - * - */ -public class Infeed extends Subsystem { - - private DoubleSolenoid feederArm; - private VictorSP feederBar; - - private double FEED_SPEED; - - private AnalogInput pressureSensor; - private double inputVoltage; - private final static double DEFAULT_VOLTS = 5.0; - private final int SLOPE = 250; - private final int Y_INTERCEPT = -20; - - public Infeed(){ - feederArm = new DoubleSolenoid(RobotMap.PCM_ID, RobotMap.INFEED_IN, RobotMap.INFEED_OUT); - feederBar = new VictorSP(RobotMap.INFEEDER_BAR); - - FEED_SPEED = 0.9; - - pressureSensor = new AnalogInput(RobotMap.PRESSURE_SENSOR); - inputVoltage = DEFAULT_VOLTS; - } - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - // setDefaultCommand(new feederControl()); - } - - public void feedDirection(int direction){ - feederBar.set(FEED_SPEED * direction); - } - - public void armUpDown(int direction){ - if(direction == 1){ - feederArm.set(DoubleSolenoid.Value.kForward); - } - else if(direction == -1){ - feederArm.set(DoubleSolenoid.Value.kReverse); - } - } -} - diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/Loader.java b/src/org/usfirst/frc/team5401/robot/subsystems/Loader.java deleted file mode 100644 index 5c853d7..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/Loader.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; -import edu.wpi.first.wpilibj.VictorSP; -import org.usfirst.frc.team5401.robot.RobotMap; - -/** - * - */ -public class Loader extends Subsystem { - - // Put methods for controlling this subsystem - // here. Call these from Commands. - - private VictorSP Conveyors; - private VictorSP meteringBar; - - private double loadSpeed; - private boolean enabled; - - public Loader(){ - - Conveyors = new VictorSP(RobotMap.conveyors); - meteringBar = new VictorSP(RobotMap.meteringMotor); - - loadSpeed = -.8; - enabled = false; - - } - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } - public void runLoader(){ - enabled = true; - Conveyors.set(loadSpeed); - meteringBar.set(loadSpeed); - - } - - public void stopLoader(){ - enabled = false; - Conveyors.set(0); - meteringBar.set(0); - } - - public boolean isEnabled(){ - return enabled; - } - - public void switchState(){ - if(!enabled){ - runLoader(); - } - else{ - stopLoader(); - } - } -} - - - diff --git a/src/org/usfirst/frc/team5401/robot/subsystems/Unjammer.java b/src/org/usfirst/frc/team5401/robot/subsystems/Unjammer.java deleted file mode 100644 index 0f92888..0000000 --- a/src/org/usfirst/frc/team5401/robot/subsystems/Unjammer.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.usfirst.frc.team5401.robot.subsystems; - -import edu.wpi.first.wpilibj.command.Subsystem; -import edu.wpi.first.wpilibj.DoubleSolenoid; -import org.usfirst.frc.team5401.robot.RobotMap; - -/** - * - */ -public class Unjammer extends Subsystem { - - // Put methods for controlling this subsystem - // here. Call these from Commands. - - private DoubleSolenoid unjam; - - public Unjammer(){ - unjam = new DoubleSolenoid(RobotMap.PCM_ID, RobotMap.UNJAM_IN, RobotMap.UNJAM_OUT); - } - - public void initDefaultCommand() { - // Set the default command for a subsystem here. - //setDefaultCommand(new MySpecialCommand()); - } - - public void unjamOut(){ - unjam.set(DoubleSolenoid.Value.kForward); - } - - public void unjamIn(){ - unjam.set(DoubleSolenoid.Value.kReverse); - } -} -