right.whenPressed(1, new CloseClaw());
right.whenReleased(1, new OpenClaw());
+
+ right.whenPressed(11, new TurnOffCompressor());
+ right.whenPressed(12, new TurnOffCompressor());
+
+ right.whenPressed(7, new TurnOnCompressor());
+ right.whenPressed(8, new TurnOnCompressor());
}
public double getForwardL() {
protected static Arm arm;
protected static Claw claw;
+ protected static Pneumatics pneumatics;
+
public CommandBase(String commandName) {
super(commandName);
drivetrain = Robot.drivetrain;
arm = Robot.arm;
claw = Robot.claw;
+
+ pneumatics = Robot.pneumatics;
}
protected void initialize() {}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands;
+
+public class TurnOffCompressor extends CommandBase {
+
+ public TurnOffCompressor() {
+ super("TurnOffCompressor");
+ requires(pneumatics);
+ }
+
+ protected void initialize() {
+ pneumatics.stop();
+ }
+
+ protected boolean isFinished() {
+ return true;
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands;
+
+public class TurnOnCompressor extends CommandBase {
+
+ public TurnOnCompressor() {
+ super("TurnOnCompressor");
+ requires(pneumatics);
+ }
+
+ protected void initialize() {
+ pneumatics.start();
+ }
+
+ protected boolean isFinished() {
+ return true;
+ }
+}