Thread: Timer Question
View Single Post
  #3   Spotlight this post!  
Unread 28-03-2007, 22:57
lightning_blast lightning_blast is offline
Registered User
FRC #1814
 
Join Date: Feb 2006
Location: Canada
Posts: 15
lightning_blast is an unknown quantity at this point
Re: Timer Question

Quote:
Originally Posted by yoyodyne View Post
That would work except that I think your autonomous code will start running a little before the disabled_mode is turned off so it will time out faster as a result. You could add

if (disabled_mode)
timer = 0;

in your autonomous loop and then it will not actually start to increment until the autonomous period actually starts.


If you want you can use a more capable e timer capability. I posted the team 116 timer library which allows you to run up to 10 software elapsed timers and 10 event timers that actually will call a routine when they time out. If you are interested in that look toward the bottom of this thread.

http://www.chiefdelphi.com/forums/sh...dware+t imers

Good luck,

Greg
wow thats a lot. we'd definately consider it if we had the time but we are VERY short on time, planning to program this on the spot so we have a moving robot in autonomous =D (even if it does nothing useful). so i think its best for us to stick with a simple timer code. By the way, u said there may be some problems with disabled mode? is the

if (disabled_mode)
timer = 0;

the actual code for it? as in, can we use this exact code and ensure the program will work? thanks