EasyManuals Logo

Parallax Boe-Bot User Manual

Parallax Boe-Bot
360 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #87 background imageLoading...
Page #87 background image
Chapter 2: Your Boe-Bot’s Servo Motors · Page 73
anotherValue VAR Word
These commands are examples of initializing variables to values that you determine.
After these two commands are executed,
value will store 500, and anotherValue will
store 2000.
value = 500 ' Initialize variables
anotherValue = 2000
These DEBUG commands help you see what each variable stores after you initialize them.
Since
value was assigned 500 and anotherValue was assigned 2000, these DEBUG
commands send the messages “value = 500” and “anotherValue = 2000” to the Debug
Terminal.
DEBUG ? value ' Display values
DEBUG ? anotherValue
The DEBUG command’s “?” formatter can be used before a variable to make the Debug
Terminal display its name, the decimal value it’s storing, and a carriage return. It’s very
handy for looking at the contents of a variable.
The riddle in the next three lines is, what will be displayed? The answer is that
value
will be set equal to ten times
anotherValue. Since anotherValue is 2000, value will
be set equal to 20,000. The
anotherValue variable is unchanged.
value = 10 * anotherValue ' Perform operations
DEBUG ? value ' Display values again
DEBUG ? anotherValue
Your Turn – Calculations with Negative Numbers
If you want to do calculations that involve negative numbers, you can use the DEBUG
command’s
SDEC formatter to display them. Here’s an example that can be made by
modifying VariablesAndSimpleMath.bs2.
Delete this portion of VariablesAndSimpleMath.bs2:
value = 10 * anotherValue ' Perform operations
DEBUG ? value ' Display values again
Replace it with the following:

Table of Contents

Other manuals for Parallax Boe-Bot

Questions and Answers:

Question and Answer IconNeed help?

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

Parallax Boe-Bot Specifications

General IconGeneral
BrandParallax
ModelBoe-Bot
CategoryRobotics
LanguageEnglish