Parallax Boe-Bot Student Manual page 42

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

Page 28 · Robotics with the Boe-Bot
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:
' {$STAMP BS2}
' {$PBASIC 2.5}
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
DEBUG "Hello, this is a message from your Boe-Bot."
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
END
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
formatter is a code-word you can use to make the message the BASIC Stamp
DEBUG
sends look a certain way in the Debug Terminal.
makes the Debug Terminal display a decimal value. An example of a control character is
, which sends a carriage return to the Debug Terminal. The text or numbers that come
CR
after a
will appear on the line below characters that came before it. You can modify
CR
your program so that it contains more
control characters. Here's an example of how to do it:
First, save the program under a new name by clicking File and selecting Save As .
command:
DEBUG
command:
END
is an example of a formatter that
DEC
commands along with some formatters and
DEBUG

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Boe-Bot and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF