Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Delay in autonomous mode (http://www.chiefdelphi.com/forums/showthread.php?t=35156)

SpeakerSilenced 21-02-2005 16:42

Delay in autonomous mode
 
Is there a simple way of delaying in autonomous mode?

Mr. Lim 22-02-2005 10:58

Re: Delay in autonomous mode
 
Quote:

Originally Posted by SpeakerSilenced
Is there a simple way of delaying in autonomous mode?

At the top of your user_routines_fast.c:

Code:

static unsigned int sleeper = 0;
Where you want to delay:

Code:

if (sleeper > ???)
{
    /* code you want delayed */
}
else
    sleeper++;

For a simple autonomous mode, usually you structure your autonomous mode with a "switch/case" control block to seperate the different "sections" of your autonomous program. If you're doing this, make one of your sections the above delay, and under "code you want delayed" you place the code that moves you to your next "section".

-SlimBoJones...


All times are GMT -5. The time now is 04:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi