Thread: Delay Function
View Single Post
  #5   Spotlight this post!  
Unread 01-03-2007, 02:15
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: Delay Function

Quote:
Originally Posted by Slick View Post
Can someone show me a way to write a function that can delay the robot. I would like to write a function and put it in ‘user_routines.c’ and call it anywhere in my ‘user_routines_fast.c’ file. Simply I would like to:

{
pwm13 = 167;
pwm15 = 167;
delay = 100;
}

where ‘delay =’ would pause the robot for whatever time you gave it. Your help would be appreciated. What would the function look like? Thanks...
... for autonomous no doubt.

Perhaps you will find some insight in this recent thread

I'd suggest structuring your autonomous code to run every 26ms (off the SPI data updates), tuck some timers into that, and structure you code as a state machine.
__________________
--Dave