28125 Parallax Inc, 28125 Datasheet - Page 87

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
These commands are examples of initializing variables to values that you determine.
After these two commands are executed,
store 2000.
These
Since
commands send the messages “value = 500” and “anotherValue = 2000” to the Debug
Terminal.
The riddle in the next three lines is, what will be displayed? The answer is that
will be set equal to ten times
be set equal to 20,000. The
Your Turn – Calculations with Negative Numbers
If you want to do calculations that involve negative numbers, you can use the
command’s
modifying VariablesAndSimpleMath.bs2.
DEBUG
value
anotherValue
value = 500
anotherValue = 2000
DEBUG ? value
DEBUG ? anotherValue
value = 10 * anotherValue
DEBUG ? value
DEBUG ? anotherValue
Delete this portion of VariablesAndSimpleMath.bs2:
value = 10 * anotherValue
DEBUG ? value
Replace it with the following:
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.
SDEC
commands help you see what each variable stores after you initialize them.
was assigned 500 and
formatter to display them. Here’s an example that can be made by
VAR
anotherValue
anotherValue
Word
anotherValue
value
variable is unchanged.
. Since
will store 500, and
' Initialize variables
' Display values
' Perform operations
' Display values again
' Perform operations
' Display values again
anotherValue
was assigned 2000, these
anotherValue
is 2000,
value
DEBUG
value
DEBUG
will
will

Related parts for 28125