Add set speed and change speed commands
authorKevin Zhang <icestormf1@gmail.com>
Sat, 23 Jan 2016 02:56:18 +0000 (18:56 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Sat, 23 Jan 2016 03:37:35 +0000 (19:37 -0800)
src/org/usfirst/frc/team3501/robot/commands/ChangeShooterSpeed.java [new file with mode: 0644]
src/org/usfirst/frc/team3501/robot/commands/SetShooterSpeed.java [new file with mode: 0644]

diff --git a/src/org/usfirst/frc/team3501/robot/commands/ChangeShooterSpeed.java b/src/org/usfirst/frc/team3501/robot/commands/ChangeShooterSpeed.java
new file mode 100644 (file)
index 0000000..637afc1
--- /dev/null
@@ -0,0 +1,38 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class ChangeShooterSpeed extends Command {
+  double change = 0;
+
+  public ChangeShooterSpeed(double change) {
+    this.change = change;
+  }
+
+  @Override
+  protected void initialize() {
+    Robot.shooter.changeSpeed(change);
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return true;
+  }
+
+  @Override
+  protected void end() {
+
+  }
+
+  @Override
+  protected void interrupted() {
+  }
+
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/SetShooterSpeed.java b/src/org/usfirst/frc/team3501/robot/commands/SetShooterSpeed.java
new file mode 100644 (file)
index 0000000..98c4c97
--- /dev/null
@@ -0,0 +1,39 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class SetShooterSpeed extends Command {
+  double speed = 0.0;
+
+  public SetShooterSpeed(double speed) {
+    this.speed = speed;
+  }
+
+  @Override
+  protected void initialize() {
+    Robot.shooter.setSpeed(speed);
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return true;
+  }
+
+  @Override
+  protected void end() {
+
+  }
+
+  @Override
+  protected void interrupted() {
+
+  }
+
+}