Thread: Timer Question
View Single Post
  #1   Spotlight this post!  
Unread 28-03-2007, 22:42
pheadxdll pheadxdll is offline
Registered User
AKA: Alex
FRC #1225 (Amperage Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: North Carolina
Posts: 168
pheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud of
Re: Timer Question

Yes, that will work.

About 38 cycles = a second so you could do something like:

int delaySeconds = 38 * sec;
int counter = 0;
MOVE_FOWARD;

if(counter < delaySeconds) {
counter++;
}else{
STOP_MOVING;
}

Remember to declare the int's at the top of the routine and good luck!

Note: You could use software timers like the one posted above, but just for simplicity, fastness, and realiblity, it won't matter if you choice either one.
__________________
Amperage Robotics Team 1225
Site under-going revamp. :/

Last edited by pheadxdll : 28-03-2007 at 22:45.