![Parallax Boe-Bot Student Manual Download Page 48](http://html2.mh-extra.com/html/parallax/boe-bot/boe-bot_student-manual_3646721048.webp)
Page 34 ·
Robotics with the Boe-Bot
Example Program – AsciiName.bs2
√
Enter and run AsciiName.bs2.
Remember to use the toolbar icons to place Compiler Directives into your programs!
'{$STAMP BS2} -
Use the diagonal green electronic chip icon
.
'{$PBASIC 2.5} -
Use the gear icon labeled 2.5.
You can see a picture of these icons again on page 24.
' 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
DEBUG
command corresponds to one ASCII code symbol that appeared
in the Debug Terminal.
DEBUG 66,65,83,73,67,32,83,116,97,109,112,32,50
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
DEBUG
to execute each symbol as a
separate command. This is much easier to type than 12 separate
DEBUG
commands.
Your Turn – Exploring ASCII Code
√
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!
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.