28125 Parallax Inc, 28125 Datasheet - Page 42

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
There are several special messages that you can send to the BASIC Stamp Editor by
placing them inside comments (to the right of an apostrophe on a given line). These are
called compiler directives, and every program in this text will use these two directives:
The first directive is called the Stamp directive, and it tells the BASIC Stamp Editor that
you will be downloading the program to a BASIC Stamp 2. The second directive is
called the PBASIC directive, and it tells the BASIC Stamp Editor that you are using
version 2.5 of the PBASIC programming language.
A command is a word you can use to tell the BASIC Stamp to do a certain job. The first
of the two commands in this program is called the
This is the command that tells the BASIC Stamp to send a message to the PC using the
serial cable.
The second command is called the
This command is handy because it puts the BASIC Stamp into low power mode when it’s
done running the program. In low power mode, the BASIC Stamp waits for either the
Reset button to be pressed (and released), or for a new program to be loaded into it by the
BASIC Stamp Editor. If the Reset button on your board is pressed, the BASIC Stamp
will run the program you loaded into it again. If a new program is loaded into it, the old
one is erased, and the new program begins to run.
Your Turn – DEBUG Formatters and Control Characters
A
sends look a certain way in the Debug Terminal.
makes the Debug Terminal display a decimal value. An example of a control character is
CR
after a
your program so that it contains more
control characters. Here’s an example of how to do it:
, which sends a carriage return to the Debug Terminal. The text or numbers that come
DEBUG
CR
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Hello, this is a message from your Boe-Bot."
END
First, save the program under a new name by clicking File and selecting Save As .
formatter is a code-word you can use to make the message the BASIC Stamp
will appear on the line below characters that came before it. You can modify
END
DEBUG
command:
commands along with some formatters and
DEBUG
DEC
is an example of a formatter that
command:

Related parts for 28125