2
e
Table 5.69: RUN Quick Facts.
A
RUN.
SIMPLE EXAMPLE OF
5: BASIC Stamp Command Reference – RUN
RUN
2
2
RUN Program
sx
p
Function
Switches execution to another BASIC Stamp program (in a different
program slot).
• Program is a variable/constant/expression (0 – 7) that specifies the
program slot to run.
Quick Facts
Number of
program slots
Time delay to
switch between
program slots
Special notes
Explanation
The BS2e, BS2sx and BS2p have a total of 16k bytes of code space. This
code space is organized into eight slots of 2 kbytes each. Up to eight
different programs can be downloaded to the BASIC Stamp (one program
per slot). When the BASIC Stamp powers up, or is reset, the program in
slot 0 is executed.
The RUN command allows you to activate another program and causes
the BASIC Stamp to stay in the newly activated program until it receives
another RUN command, or until a power-down or reset condition occurs.
The RUN command is similar to a GOTO command in that it allows you
to "goto" another program. Normally a master-type program will be used
in program slot 0 (since slot 0 runs first) and will control initial execution
of the other programs.
Look at the following example (there are two programs here, make sure to
download them into program slots 0 and 1, respectively):
BS1
BS2
BS2e BS2sx BS2p
BS2e
770 µs
RUN is similar to a GOTO... you can not "return" from a RUN
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 269
BS2sx
8 (numbered 0 to 7)
300 µs
BS2p
250 µs
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?