Limit of timers in RobotC
Page 1 of 1

Author:  yudopplyr [ Sun Oct 27, 2013 1:41 pm ]
Post subject:  Limit of timers in RobotC

Hi guys, I'm currently using the timers that you can use in robotc time1[T1],time10[T2],etc.

My question here is what happens when the timer reaches it's limit?, I know the limit value that they can take (timer1,time10,,time100) is 32768, but do I need to reset the timer afterwards or can I leave the timer like that untill I need to reset it for another function that ocuppies the same timer, this meaning that the the limit is only of the especific array (time1,time10,time100) and not the timer itself.

Author:  Ernest3.14 [ Sun Oct 27, 2013 10:13 pm ]
Post subject:  Re: Limit of timers in RobotC

When it goes over 32768, it goes to -32768 and starts again. So as long as you don't read from it, you don't need to reset it. I don't think each array has a different timer; they all share one.

Author:  mightor [ Mon Oct 28, 2013 2:04 am ]
Post subject:  Re: Limit of timers in RobotC

If you want additional timers, you may want to take a look at timer-test1.c and timer.h in the NXT sample programs directory.

It supports the following operations:
int TMRnewTimer();
bool TMRisExpired(int timerIdx);
void TMRreset(int timerIdx);
void TMRreset(int timerIdx, long duration);
void TMRsetup(int timerIdx, long duration);

It's fairly easy to use and you can have as many as you like.


Author:  tfriez [ Thu Oct 31, 2013 4:10 pm ]
Post subject:  Re: Limit of timers in RobotC

Only on the VEX PIC is it a 16-bit number. On VEX Cortex it's a 32-bit number, so it goes MUCH higher until you need to reset.

For ROBOTC 4.0 we're actually depreciating the Time10 and Time100 commands.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group