View unanswered posts | View active topics It is currently Fri Oct 24, 2014 11:14 pm

Reply to topic  [ 4 posts ] 
Limit of timers in RobotC 
Author Message

Joined: Sat Oct 12, 2013 2:04 pm
Posts: 1
Post 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.

Sun Oct 27, 2013 1:41 pm
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post 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.

FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!

Sun Oct 27, 2013 10:13 pm
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post 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.


| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Mon Oct 28, 2013 2:04 am
Profile WWW
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 613
Post 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.

Timothy Friez
ROBOTC Developer - SW Engineer

Thu Oct 31, 2013 4:10 pm
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.