User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
151
Prototype
void Delay_us(const unsigned long time_in_us);
Description Creates a software delay in duration of time_in_us microseconds.
This is an “inline” routine; code is generated in the place of the call, so the call doesn’t count against
the nested call limit.
Parameters time_in_us: delay time in microseconds. Valid values: constant values, range of applicable
constants depends on the oscillator frequency
Returns Nothing.
Requires Nothing.
Example
Delay_us(10); /* Ten microseconds pause */
Notes None.
Prototype
void Delay_ms(const unsigned int time_in_ms);
Description Creates a software delay in duration of time_in_ms milliseconds.
This is an “inline” routine; code is generated in the place of the call, so the call doesn’t count against
the nested call limit.
Parameters time_in_ms: delay time in milliseconds. Valid values: constant values, range of applicable constants
depends on the oscillator frequency
Returns Nothing.
Requires Nothing.
Example
Delay_ms(1000); /* One second pause */
Notes For generating delays with variable as input parameter use the Vdelay_ms routine.
Prototype
void Vdelay_ms(unsigned Time_ms);
Description Creates a software delay in duration of Time_ms milliseconds. Generated delay is not as precise as
the delay created by Delay_ms.
Parameters Time_ms: delay time in milliseconds
Returns Nothing.
Requires Nothing.
Example
unsignedpause = 1000;
...
Vdelay_ms(pause); // ~ one second pause
Notes Vdelay_ms is a library function rather than a built-in routine; it is presented in this topic for the sake
of convenience.
Delay_us
Delay_ms
Vdelay_ms