BASIC stamp manual v2.2
BASIC Stamp Architecture – PIN Symbols
Page 102 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
PIN_Symbol behaves like a constant:
1. when used in a command’s Pin argument. Example:
OUTPUT PIN_Symbol
2. when used in the index of an array. Example:
myArray(PIN_Symbol) = 25
PIN_Symbol behaves like an input variable (INx):
1. when used in a command’s non-Pin argument that expects to
read a variable/constant/expression. Example:
DEBUG BIN PIN_Symbol
2. when used in a command’s Condition argument. Example:
IF PIN_Symbol = 1 THEN…
3. when used to the right of the equal sign (=) in an assignment
statement. Example:
ex: myVariable = PIN_Symbol + 1
PIN_Symbol behaves like an output variable (OUTx):
1. when used in a command’s non-Pin argument that expects to
write a result to a variable. Example:
LOOKUP index, [0, 1, 1, 0, 1], PIN_Symbol
2. when used to the left of the equal sign (=) in an assignment
statement. Example:
PIN_Symbol = 1
Let’s talk about the four basic operations of arithmetic: addition (+),
subtraction (-), multiplication (*), and division (/).
You may recall that the order in which you do a series of additions and
subtractions doesn’t affect the result. The expression 12+7-3+22 works out
the same as 22-3+12+7. However, when multiplication or division are
involved, it’s a different story; 12+3*2/4 is not the same as 2*12/4+3. In
fact, you may have the urge to put parentheses around portions of those
equations to clear things up.
1
A
ll
2
BASIC ARITHMETIC OPERATIONS