Pause

Syntax:

Fixed Length Delay:
    Pause time_ms

Command Availability:

Available on all microcontrollers.

Explanation:

The Pause command causes the program to pause for a specified time in milliseconds. The only unit of time permitted is milliseconds — unlike Wait, Pause takes a bare number and always treats it as milliseconds.

Pause is an older, simpler command kept for compatibility with existing programs. For new code, use the Wait command instead, since it supports a full range of time units (microseconds through hours) and conditional forms (Wait While/Wait Until).

Example:

    #chip 16F628A, 4

    #define LIGHT PORTB.0
    Dir LIGHT Out

    Do
      Set LIGHT On
      Pause 500          ' <<< the Pause instruction
      Set LIGHT Off
      Pause 500
    Loop

Key line: Pause 500 — pauses the program for 500 milliseconds; the bare number 500 is always interpreted as milliseconds, unlike Wait, which requires an explicit unit such as 500 ms.

See Also:

  • Wait — the modern replacement, supporting more units and conditional delays