package org.usfirst.frc.team997.robot.commands;

import org.usfirst.frc.team997.robot.Robot;

import edu.wpi.first.wpilibj.command.Command;

/**
 *
 */
public class SpinUpShooter extends Command {
	private static int togglespin;
	/**
	 * this will be a toggle button that spins up the wheels and stops them based on when its pressed.
	 */
    public SpinUpShooter() {
    	togglespin = 0;
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
    	requires(Robot.shooter);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    if (togglespin == 0){
    	Robot.shooter.speedUp();
    	togglespin = 1;
    } else{
    	Robot.shooter.slowDown();
    	togglespin = 0;
    }
    		
    	
    }

    // 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() {
    }
   

}

@@ -210,24 +210,67 @@
 tic 
-int t
+boolean toggleSpin = true;%0A%09private boolean myT
 oggle
-s
+S
 pin;%0A
+%0A
 %09/**
@@ -375,20 +375,17 @@
 d.%0A%09 */%0A
-    
+%09
 public S
@@ -405,332 +405,132 @@
 ) %7B%0A
-    %09togglespin = 0;%0A        // Use requires() here to declare subsystem dependencies%0A        // eg. requires(chassis);%0A    %09requires(Robot.shooter);%0A    %7D%0A%0A    // Called just before this Command runs the first time%0A    protected void initialize() %7B%0A    %7D%0A%0A    // Called repeatedly when this Command is scheduled to run%0A    
+%09%09requires(Robot.shooter);%0A%09%7D%0A%0A%09protected void initialize() %7B%0A%09%09myToggleSpin = toggleSpin;%0A%09%09toggleSpin = !toggleSpin;%0A%09%7D%0A%0A%09
 prot
@@ -556,38 +556,32 @@
 ) %7B%0A
-    
+%09%09
 if (
-t
+myT
 oggle
-spin == 0)%7B%0A    
+Spin) %7B%0A%09%09
 %09Rob
@@ -606,45 +606,21 @@
 ();%0A
-    %09togglespin = 1;%0A    
+%09%09
 %7D else
+ 
 %7B%0A
-    
+%09%09
 %09Rob
@@ -646,400 +646,165 @@
 ();%0A
-    %09togglespin = 0;%0A    %7D%0A    %09%09%0A    %09%0A    %7D%0A%0A    // Make this return true when this Command no longer needs to run execute()%0A    protected boolean isFinished() %7B%0A        return false;%0A    %7D%0A%0A    // Called once after isFinished returns true%0A    protected void end() %7B%0A    %7D%0A%0A    // Called when another command which requires one or more of the same%0A    // subsystems is scheduled to run%0A    
+%09%09%7D%0A%09%7D%0A%0A%09protected boolean isFinished() %7B%0A%09%09return !myToggleSpin %7C%7C myToggleSpin == toggleSpin;%0A%09%7D%0A%0A%09protected void end() %7B%0A%09%09Robot.shooter.slowDown();%0A%09%7D%0A%0A%09
 prot
@@ -834,17 +834,37 @@
 ) %7B%0A
-    %7D%0A   %0A
+%09%09Robot.shooter.slowDown();%0A%09%7D
 %0A%7D%0A

Fix SpinUpShooter to toggle