View Single Post
  #2   Spotlight this post!  
Unread 27-03-2012, 19:46
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Motors stop running in autonomous

Yea - you may be getting bit by the automatic expiration.

Your re-vamp code looks better, but I'd suggest during your 'while()' that you also put a "Wait(0.1)" so that you're not in a total tight-loop situation which might cause other issues with other tasks on the cRio. I don't know of any such issues, but a tight loop isn't a good thing either.

Code:
Timer timer;
timer.Reset();
timer.Start();

while (timer.Get() < 2.0)
{
  myRobot.Drive(0.6, 0.0);
  Wait(0.1);
}
 
myRobot.Drive(0.0, 0.0);
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote