Here are the commands:
Code:
package edu.wpi.first.LFRobot2014.commands;
/**
*
* @author FrankyMonezz
*/
public class PrepBall extends CommandBase {
public PrepBall() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
requires(launchservo);
}
// Called just before this Command runs the first time
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
//move servo to 45 degrees
launchservo.setPos(45);
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return (launchservo.getPos() == 45);
}
// 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() {
}
}
Code:
package edu.wpi.first.LFRobot2014.commands;
/**
*
* @author FrankyMonezz
*/
public class PrepBall2 extends CommandBase {
public PrepBall2() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
requires(launchservo);
}
// Called just before this Command runs the first time
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
//move servo back to default location
launchservo.setPos(0);
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return (launchservo.getPos() == 0);
}
// 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() {
}
}
I will try putting in a wait command tomorrow - THANKS!