5: BASIC Stamp Command Reference – RUN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 269
RUN
BS1 BS2
BS2e BS2sx BS2p
RUN
Program
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
BS2e
BS2sx
BS2p
Number of
program slots
8 (numbered 0 to 7)
Time delay to
switch between
program slots
770
µ
s
300
µ
s
250
µ
s
Special notes
RUN is similar to a GOTO… you can not "return" from a RUN
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):
e
2
sx
2
p
2
Table 5.69: RUN Quick Facts.
A
SIMPLE EXAMPLE OF
RUN.
Summary of Contents for BASIC Stamp 2e
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...