Mikroelektronika MIKROE-350 Fiche De Données

Page de 526
Delay_us
Delay_ms
Vdelay_ms
98
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Specifics
mikroBasic PRO for AVR
CHAPTER 3
Prototype
sub procedure Delay_us(const time_in_us as longword)
Returns
Nothing.
Description
Creates a software delay in duration of 
time_in_us
microseconds (a constant).
Range of applicable constants depends on the oscillator frequency.
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.
Requires
Nothing.
Example
Delay_us(1000)  ' One millisecond pause
Prototype
sub procedure Delay_ms(const time_in_ms as longword)
Returns
Nothing.
Description
Creates a software delay in duration of 
time_in_ms
milliseconds (a constant).
Range of applicable constants depends on the oscillator frequency.
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.
Requires
Nothing.
Example
Delay_ms(1000)  ' One second pause
Prototype
sub procedure Vdelay_ms(time_in_ms as word)
Returns
Nothing.
Description
Creates a software delay in duration of 
time_in_ms
milliseconds (a variable).
Generated delay is not as precise as the delay created by Delay_ms.
Note that 
Vdelay_ms
is library function rather than a built-in routine; it is pre-
sented in this topic for the sake of convenience.
Requires
Nothing.
Example
pause = 1000
' ...
Vdelay_ms(pause)  ' ~ one second pause