gt: 			final double[] currentRPM = Robot.flywheels.getRPM();
context: package org.usfirst.frc.team5431.robot;
  
  import edu.wpi.first.wpilibj.Timer;
  import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
  
  public class SwitchCase {
  	private static double[] encodersDistance = { 0, 0 };
  	// private double[] encodersRPM = {0};
  	private static final double wheelCircum = driveBase.wheelDiameter * Math.PI;
  	private static double driveForwardDistance = 0;
  	static Vision cameraVision = new Vision();
  	private static boolean pass = false;
  	public final static int abortAutoAim = -42; // Get the joke, anyone?
  	private static long autoshootTimer = 0;
  	private static long autoAimTurnTimer = 0;
  	private static long autoAimIntakeTimer = 0;
  	private static long autoAimManualTimer = 0;
  	private static long chopperDownTimer = 0;
  	private static long shootTimer = 0;
  	private static float initRoll = 0.0f;
  	private static float initPitch = 0.0f;
  	private static float changeRoll = 0.0f;
  	private static float changePitch = 0.0f;
  	private static float changePitchMax = 0.0f;
  	private static float changeRollMax = 0.0f;
  	private static long forwardGyro_neededTime = 0;
  	private static long forwardGyro_landTime = 0;
  	private static long forwardGyro_landTurn = 0;
  	private static long FlyWheelTimer = 0;
  	public static int currAIM = 1;
  	private static double[] driveDistance = { 0, 0 };
  	
  	// private static int autoAimRemoteState = 0; //Used for the shoot()
  	// function within autoAim()
  	private static final int[] off = { 0, 0 };
  	private static boolean inAuto = false;
  	public static final double moveAmount = 0.455;//.42 for comp
  	public static int checkAmount = 3;
  	private static int timesCount = 0;
  	public static boolean shotTheBall = false;
  	private static final double percentRange = 0.02;
  	
  	
  	
  	private static final int minVal = -80, maxVal = 80;
  	public SwitchCase() {
  
  	}
  
  	/**
  	 * Function that uses switch-case autonomous to allow the robot to drive
  	 * forward at full speed until the driveForwardDistance specified in
  	 * Autonomous.java. <b>Should only be called within updateStates()</b> Won't
  	 * work otherwise.
  	 * 
  	 * @param state
  	 * @return state
  	 */
  	public static int driveForward(int state, int distance) {
  		switch (state) {
  		default:
  			break;
  		case 0:
  			break;
  		case 1:
  			driveForwardDistance = wheelCircum * distance;
  			Robot.drivebase.drive(.75, .75);
  			state = 2;
  			break;
  		case 2:
  			encodersDistance = Robot.drivebase.getEncDistance();
  			if (encodersDistance[0] > driveForwardDistance || encodersDistance[1] > driveForwardDistance) {
  				Robot.drivebase.drive(0.0, 0.0);
  				state = 3;
  			}
  			break;
  		case 3:
  			state = 0;
  			break;
  		}
  		return state;
  	}
  	
  	public static int driveForwardGyro(int state, double distancetocrosswork){
  		switch(state){
  		default:
  			break;
  		case 0:
  			break;
  		case 1:
  			driveForwardDistance = wheelCircum * distancetocrosswork;
  			//Robot.gyro.reset();
  			Robot.drivebase.drive(-.75, -.75);
  			state = 2;
  		case 2:
  			encodersDistance = Robot.drivebase.getEncDistance();
  			if (encodersDistance[0] > driveForwardDistance || encodersDistance[1] > driveForwardDistance) {
  				Robot.drivebase.drive(0.0, 0.0);
  				state = 3;
  			}
  			else{
  				/*if(Robot.gyro.getAngle() > 1){
  					Robot.drivebase.drive(-.76, -.75);
  				}
  				else if(Robot.gyro.getAngle() < -1){
  					Robot.drivebase.drive(-.75, -.76);
  				}
  				else{
  					Robot.drivebase.drive(-.75, -.75);
  				}*/
  			}
  		case 3:
  			state = 0;
  		}
  		return state;
  	}
  
  	/**
  	 * Function that uses switch-case autonomous to allow the robot to
  	 * constantly look for a target to do auto-aim then fires.. <b>Should only
  	 * be called within updateStates().</b> Won't work otherwise.
  	 * 
  	 * @param state
  	 * @return state
  	 */
  	public static int autoAim(int state, int shootSpeed) {
  		//SmartDashboard.putNumber("STATE STATE STATE", state);
  		SmarterDashboard.putBoolean("AUTO", state > 0);
  
  		switch (state) {
  		default:
  			break;
  		case 0:
  			cameraVision.Update();
  			inAuto = false;
  			//timesCount = 0;
  			break;
  		case 1:
  			////SmartDashboard.putNumber("STATE STATE STATE", state);
  			////SmartDashboard.putNumber("COUNTINGDUDE", timesCount);
  			////SmartDashboard.putBoolean("PASSED?", false);
  			//timesCount += 1;
  			// If David's autoAim code says to shoot
  			cameraVision.Update();
  			pass = true;
  			/*
  			if (Vision.distance > 80 && Vision.distance < 94) {
  				pass = true;
  			} else if (Vision.distance < 94) {
  				Robot.drivebase.drive(0.7, 0.7);
  				state = 1;
  				pass = false;
  			} else if (Vision.distance > 80) {
  				Robot.drivebase.drive(-0.7, -0.7);
  				state = 1;
  				pass = false;
  			} else {
  				//SmartDashboard.putNumber("CRAPSTUFF", Vision.manVals[1]);
  			} *//*
  				 * else if (Vision.manVals[0] == 5) {// || Vision.manVals[1] ==
  				 * 5){ } SmarterDashboard.putString("ERROR",
  				 * "It's too close and too far"); Robot.drivebase.drive(0, 0);
  				 * state = abortAutoAim;
  				 * 
  				 * }
  				 */
  
  			// You get it now, right?
  			if (pass) {
  				////SmartDashboard.putBoolean("PASSED?", true);
  
  				Robot.drivebase.enableBrakeMode();
  				if (Vision.manVals[0] == 0) {
  					state = 4;
  					/*
  					 * if (timesCount > checkAmount) { state = 4;// Change when
  					 * you want f/backward } else { state = 1; timesCount += 1;
  					 * Timer.delay(0.1); }
  					 */
  				} else if (Vision.manVals[0] == 1) {
  					Robot.drivebase.drive(-moveAmount, moveAmount);
  					state = 1;
  				} else if (Vision.manVals[0] == 2) {
  					Robot.drivebase.drive(moveAmount, -moveAmount);
  					state = 1;
  				} else if (Vision.manVals[0] == 5) {// || Vision.manVals[1] ==
  													// 5){
  					SmarterDashboard.putString("ERROR", "It's too close and too far");
  					Robot.drivebase.drive(0, 0);
  					state = abortAutoAim;
  
  				} else {
  					state = abortAutoAim; // manVals[0] should only be 0-2.
  											// Nothing else. Somethign is wrong.
  				}
  			}
  			break;
  		/*
  		 * case 3: cameraVision.Update(); //SmartDashboard.putNumber(
  		 * "STATE STATE STATE", state); if(Vision.manVals[1] == 0){
  		 * if(Vision.manVals[0] != 0)//Make sure turn left + right is alright
  		 * state = 2; else{ state = 4; //autoAimRemoteState = 1;
  		 * //SmartDashboard.putNumber("remoteBugIn", autoAimRemoteState); } } else
  		 * if(Vision.manVals[1] == 1){ Robot.drivebase.drive(-0.55, -0.55);
  		 * state = 3; } else if(Vision.manVals[1] == 2){
  		 * Robot.drivebase.drive(.55, .55); state = 3; } else state =
  		 * abortAutoAim; break;
  		 */
  		case 4:
  			//Robot.drivebase.disableBrakeMode();
  			////SmartDashboard.putNumber("STATE STATE STATE", state);
  			// //SmartDashboard.putNumber("remoteBug", autoAimRemoteState);
  			// autoAimRemoteState =
  			// if(autoAimRemoteState == 4)
  			// state = 0;
  			inAuto = true;
  			state = 5;
  			break;
  		case 5:
  			autoshootTimer = System.currentTimeMillis() + 3000;
  			state = 6;
  			// have to make this better, made into 4 states:
  			// state 5 is to spin the flywheels
  			// state 6 checks if the rpm is correct, and if so, go to state 7
  			// state 7 intakes it
  			// state 8 checks if a second passes, and if so, go to state 0
  		case 6:
  			//this used to do something, but we removed it, and i dont want to change all the numbers again
  			state = 7;
  			break;
  		case 7:
  
  			// state = 5;
  			// shootStates = shoot(shootStates, 0.8);
  			// if(shootStates == 0) {state = -1;}
  