Specifications
BASIC Stamp II
Page 288 • BASIC Stamp Programming Manual 1.8 • Parallax, Inc.
Pause
PAUSE
milliseconds
Pause the program (do nothing) for the specified number of millisec-
onds.
•
Milliseconds
is a variable/constant specifying the length of the
pause in ms. Pauses may be up to 65535 ms (65+ seconds) long.
Explanation
Pause delays the execution of the next program instruction for the speci-
fied number of milliseconds. For example:
flash:
low 0
PAUSE 100
high 0
PAUSE 100
goto flash
This code causes pin 0 to go low for 100 ms, then high for 100 ms. The
delays produced by Pause are as accurate as the ceramic-resonator
timebase, ±1 percent. When you use Pause in timing-critical applica-
tions, keep in mind the relatively low speed of the PBASIC interpreter;
about 3000 instructions per second. This is the time required for the
BS2 to read and interpret an instruction stored in the EEPROM.
Since the chip takes 0.3 milliseconds to read in the Pause instruction,
and 0.3 milliseconds to read in the instruction following it, you can count
on loops involving Pause taking almost 1 millisecond longer than the
Pause period itself. If you’re programming timing loops of fairly long
duration, keep this (and the 1-percent tolerance of the timebase) in mind.
Demo Program
This program demonstrates the Pause instruction’s time delays. Once
a second, the program will put the debug message “paused” on the
screen.
again:
PAUSE 1000
debug "paused",cr
goto again










