Tuesday, June 30, 2015

Useful Delay Function

It always takes a while to poke around the blog and find the delay function to copy and paste, so here it is:

void delay(int nStopValue)
/**
* \brief       Loop for nStopValue iterations to provide a delay.
* \par         Details
*              It is commonly used with the constant 'ABOUT_ONE_SECOND' defined in maximPMOD.h for
*              setting approximate delays
*
* \param[in]   nStopValue    - number of iterations to loop
*
* \retval      None
*/
{
    int i=0;
    int a=0;

    for(i=0;i<nStopValue;i++)
    {
        a=i;
    }
}


******USE THIS DEFINITION TO PASS INTO THE DELAY FUNCTION******

#define ABOUT_ONE_SECOND 74067512

No comments:

Post a Comment