|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Loop in autonomous carries on into teleop and stops anything from working?
This is occurring because you enter the do while loop and never reset x to a value less that 0, meaning the code continuously runs through this loop.
|
|
#2
|
||||
|
||||
|
Re: Loop in autonomous carries on into teleop and stops anything from working?
Funny, we fixed that, and still have the error with our very simple fix.
This does the same thing. Code:
timer.start();
do{
drivetrain.drive(0.5,0.0);
}while(timer.get()<4);
|
|
#3
|
||||
|
||||
|
Re: Loop in autonomous carries on into teleop and stops anything from working?
Do this instead:
Code:
while (isAutonomous() && isEnabled()) {
// Autonomous code
}
|
|
#4
|
||||
|
||||
|
Re: Loop in autonomous carries on into teleop and stops anything from working?
do{
drivetrain.drive(0.5,0.0); }while(timer.get()<4 && isAutonomous()); |
|
#5
|
|||
|
|||
|
Re: Loop in autonomous carries on into teleop and stops anything from working?
I would suggest doing it the way Neal has wrote it. You can always have if statement or switch statement handling the time base options.
|
|
#6
|
||||
|
||||
|
Re: Loop in autonomous carries on into teleop and stops anything from working?
Thanks for the replies guys. What I found out was that the iterative robot class is a completely different concept than simplerobot. I was mistaken in thinking it was just more features.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|