View Single Post
  #7   Spotlight this post!  
Unread 09-02-2014, 21:11
dystopic dystopic is offline
Registered User
FRC #1261
 
Join Date: Feb 2014
Location: Duluth
Posts: 5
dystopic is an unknown quantity at this point
Re: Robots don't quit

Quote:
Originally Posted by otherguy View Post
Command base is just the IterativeRobot class using the Command and Scheduler classes.

Look at your code, the main robot class probably has a line like this...
Code:
public class Robot extends IterativeRobot {
Note the "extends IterativeRobot" part.

Same goes for command base as I said before, no loops or thread.sleeps unless you understand the consequences and know it will not affect execution of the rest of the robot code. This is especially true for the code within a command - since the code in a command shares the 20ms execution period with all other active commands.
wait so would this be fine:
Quote:
timer = new Timer();
intake_b.set(true);
timer.start();
while(timer.get() < Constants.solenoid_timing.getDouble()){

}
if(timer.get() >= Constants.solenoid_timing.getDouble()){
intake_b.set(false);
}
the timing value is 2000ms
Reply With Quote