package org.usfirst.frc.team3501.robot.commands;
-import org.usfirst.frc.team3501.robot.OI;
-import org.usfirst.frc.team3501.robot.subsystems.Shooter;
+import org.usfirst.frc.team3501.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
*
*/
public class ShooterTest extends Command {
- public static Shooter shooter;
- public static OI oi;
public ShooterTest() {
- // Use requires() here to declare subsystem dependencies
- // eg. requires(chassis);
- requires(shooter);
+
+ requires(Robot.shooter);
}
- // Called just before this Command runs the first time
@Override
protected void initialize() {
+ Robot.shooter.setSpeed(0.5);
+
}
- // Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
+ boolean triggerPressed = Robot.oi.rightJoystick.getTrigger();
+ boolean leftSidePressed = Robot.oi.leftSilverButton.get();
+ boolean rightSidePressed = Robot.oi.rightSilverButton.get();
+ boolean thumbPressed = Robot.oi.thumbButton.get();
+
+ double currentWheelSpeed = Robot.shooter.getCurrentSpeed();
+
+ if (triggerPressed == true) {
+ Robot.shooter.setSpeed(currentWheelSpeed);
+ } else {
+ Robot.shooter.setSpeed(0.0);
+ }
+
+ if (leftSidePressed == true) {
+ Robot.shooter.decrementSpeed(0.1);
+ }
+
+ if (rightSidePressed == true) {
+ Robot.shooter.incrementSpeed(0.1);
+ }
+
+ if (thumbPressed == true) {
+ System.out.println(Robot.shooter.getCurrentSpeed());
+ }
+
}
// Make this return true when this Command no longer needs to run execute()