
5: BASIC Stamp Command Reference - DEBUG
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 97
DEBUG
BS1 BS2 BS2e BS2sx BS2p
DEBUG
OutputData {, OutputData}
Function
Display information on the PC screen within the BASIC Stamp editor
program. This command can be used to display text or numbers in
various formats on the PC screen in order to follow program flow (called
debugging) or as part of the functionality of the BASIC Stamp application.
•
OutputData
is a variable/constant/expression (0 – 65535) that
specifies the information to output. Valid data can be ASCII
characters (text strings and control characters), decimal numbers (0 -
65535), hexadecimal numbers ($0000 - $FFFF) or binary numbers (up
to %1111111111111111). Data can be modified with special
formatters as explained below.
Explanation
DEBUG provides a convenient way for your BASIC Stamp to send
messages to the
PC
screen while running. The name “debug” suggests its
most popular use; debugging programs by showing you the value of a
variable or expression, or by indicating what portion of a program is
currently executing. DEBUG is also a great way to rehearse programming
techniques. Throughout this manual, we use DEBUG to give you
immediate feedback on the effects of instructions. The following example
demonstrates using the DEBUG command to send the text string message
“Hello World!”.
DEBUG "Hello World!" ' Test message.
After you download this one-line program, the BASIC Stamp Editor will
open a Debug Terminal on your PC screen and wait for a response from
the BASIC Stamp. A moment later, the phrase "Hello World!" will appear.
Note that if you close the Debug Terminal, your program keeps executing,
but you can’t see the DEBUG data anymore.
Multiple pieces of data can be sent with one DEBUG command by
separating the data with commas (,). The following example produces
exactly the same results as the example above.
DEBUG "Hello ", "World!" 'Test message
1
2
e
2
sx
2
p
2
1
NOTE: Expressions are not
allowed as arguments on the BS1.
The only constant allowed for the
BS1 DEBUG command is a text
string.
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...