28125 Parallax Inc, 28125 Datasheet - Page 48

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
Example Program – AsciiName.bs2
' Robotics with the Boe-Bot - AsciiName.bs2
' Use ASCII code in a DEBUG command to display the words BASIC Stamp 2.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG 66,65,83,73,67,32,83,116,97,109,112,32,50
END
How AsciiName.bs2 Works
Each letter in the
in the Debug Terminal.
66 is the ASCII code for capital “B”, 65 is the code for capital “A” and so on. 32 is the
code for a space between characters. Notice that each code number was separated with a
comma. The commas allow the one instance of
separate command. This is much easier to type than 12 separate
Your Turn – Exploring ASCII Code
The BASIC Stamp Manual Appendix A has a chart of ASCII code numbers and their
corresponding symbols. You can look up the corresponding code numbers to spell your
own name.
Enter and run AsciiName.bs2.
DEBUG 66,65,83,73,67,32,83,116,97,109,112,32,50
Save AsciiName.bs2 as AsciiRandom.bs2
Pick 12 random numbers between 32 and 127.
Replace the ASCII code numbers in the program with the numbers you chose.
Run your modified program to see what you get!
Remember to use the toolbar icons to place Compiler Directives into your programs!
'{$STAMP BS2} -
'{$PBASIC 2.5} -
You can see a picture of these icons again on page 24.
DEBUG
command corresponds to one ASCII code symbol that appeared
Use the diagonal green electronic chip icon
Use the gear icon labeled 2.5.
DEBUG
to execute each symbol as a
DEBUG
.
commands.

Related parts for 28125