![]() |
Autonomous
Code:
/*----------------------------------------------------------------------------*/ |
Re: Autonomous
Quote:
Your autonomous function should look like Code:
|
Re: Autonomous
Quote:
Try the following instead: Code:
public void autonomous() { |
Re: Autonomous
Another option would be to use the system clock:
We used similar code on an alliance partner's robot at week 0 and it worked flawlessly. Code:
public void autonomous() {Also you'll noticed I chanced the speed to .01, you only need to cross the line, so I would slowly increment the speed until it matches your needs. Driving at half speed for 5 seconds could have some unintended consequences. |
Re: Autonomous
It's important to actually tell your motors to stop after commanding the drivetrain to move forward for 5 seconds. Otherwise your code will go on its merry way, but the drivetrain will continue to be commanded.
Regardless of how you end up implementing the code you need to explicitly command the motors to 0. lineskier's code does this: Code:
robotDrive.drive(0.0, 0.0); |
| All times are GMT -5. The time now is 11:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi