Thread: Timers and Such
View Single Post
  #1   Spotlight this post!  
Unread 17-02-2007, 13:14
Inverted Inverted is offline
Registered User
AKA: Eric P.
FRC #1228 (Robo Tribe)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Rahway, NJ
Posts: 25
Inverted is an unknown quantity at this point
Send a message via AIM to Inverted
Timers and Such

I've forgotten most of the C that I learned a few years ago, and my mind has been clouded with the InteractiveC commands that we use in my robotics class (stupid LEGO RCX). I know about incrementing timers and doing, for example:

Code:
 timer1++;
if (timer1 < 200){
blah blah;
}
My question is does a C command exist that is the equivalent of InteractiveC's "sleep()" function? We want to have a dead reckoning backup and it would be a lot easier for me to train newbies if we could do the following instead of the former, since they already know how to write those type of programs.

Code:
pwm13 = pwm14 = 167;
pwm14 = pwm15 = 87;
sleep(2.0); //drive forward for 2 seconds
pwm07 = 205;
sleep(.5); //raise arm
blah blah
Is that possible or am I just out of luck with doing things the easy way?