Specifications

BASIC Stamp II
Page 284 • BASIC Stamp Programming Manual 1.8 • Parallax, Inc.
Low
LOW
pin
Make the specified pin output low (write 1 to the corresponding bit of
DIRS and 0 to the corresponding bit of OUTS).
Pin
is a variable/constant (0–15) that specifies the I/O pin to use.
Explanation
In order for the BS2 to actively output a 0 (a 0-volt level) on one of its
pins, two conditions must be satisfied:
(1) The corresponding bit of the DIRS variable must contain a 1 in
order to connect the pin’s output driver.
(2) The corresponding bit of the OUTS variable must contain a 0.
Low performs both of these actions with a single, fast instruction.
Demo Program
This program shows the bitwise state of the
DIRS and OUTS variables before and after the
instruction Low 4. You may also connect an
LED to pin P4 as shown in figure I-6 to see it
light when the Low instruction executes.
Dirs = % 10000 ' Initialize P4 to high
debug "Before: ",cr
debug bin16 ? dirs,bin16 ? outs,cr,cr
pause 1000
LOW 4
debug "After: ",cr
debug bin16 ? dirs,bin16 ? outs
220
LED
I/O pin
+5V
Figure I-6