Log in

View Full Version : A simple accurate timer


bruss6
23-01-2007, 17:42
What is the easiest and most accurate delay function or a timer in the user routines_fast.


P.S. One more question... Are there any rules against the use of last year's(2006 kevin's) program???

Thanks

Ben Russell :confused:

Kevin Sevcik
23-01-2007, 18:08
If you need an accurate timer, you need to use one of TIMER0-4. IFI has examples on their website under White Papers (http://www.ifirobotics.com/white-papers.shtml). They're easier than you might think. There is otherwise no way to accuratly time things in the Process_Data_From_Local_IO() function as it simply runs as fast as it runs. If you're talking about timing things in the User_Autonomous() function, you can put a simple counter inside the slow loop and it will increment once every 26.2 ms. So that's a pretty accurate and simple, if slow, timer.