Positron Compiler Documentation

DelayUs

Positron16 · Revision 1.1.3.5 · PDF page 334

DelayUs Length

Delay execution for length x microseconds (us). Delays may be up to 65535us (65.535 milliseconds) long.

Length can be a constant, variable, or expression.

Device = 24FJ64GA002           ' Select the device to compile for
Declare Xtal = 16

Dim MyByte as Byte
Dim MyWord as Word

MyByte = 50
MyWord= 1000
DelayUs 1                       ' Delay for 1us
DelayUs 100                    ' Delay for 100us
DelayUs MyByte                  ' Delay for 50us
DelayUs MyWord                  ' Delay for 1000us
DelayUs MyWord + 10             ' Delay for 1010us

DelayUs is oscillator independent, as long as you inform the compiler of the crystal frequency to use, using the Xtal directive.

See also : DelayUs, DelayMs.

View original PDF page 334Open page in PDFOriginal PDF page 334