Delay in autonomous mode

Is there a simple way of delaying in autonomous mode?

At the top of your user_routines_fast.c:


static unsigned int sleeper = 0;

Where you want to delay:


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…