package org.usfirst.frc5902.RobotBuilderTest.commands;

import org.usfirst.frc5902.RobotBuilderTest.Robot;

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

/**
 *
 */
public class DriveTillUltrasonicValue extends Command {

    public DriveTillUltrasonicValue() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
    	requires(Robot.driveTrain);
    }

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

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    	Robot.sensorBase.getDistance();
    	Robot.driveTrain.driveStraight(.33);
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        if (Robot.sensorBase.getDistance() <= 36) {
        	return true;
        }
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    	Robot.driveTrain.driveStraight(0);
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    	end();
    }
}

@@ -152,18 +152,147 @@
 d;%0A%0A/**%0A
- *
+Drives the robot until the ulrasonic sensor reads a certain distance during autonomous...seriously, you've got to read the names...
 %0A */%0Apub

Update DriveTillUltrasonicValue.java