Parallax BASIC Stamp 2e Programming Manual page 231

Table of Contents

Advertisement

5: BASIC Stamp Command Reference – POLLOUT
vital that a large enough series resister (perhaps 100 ohms or greater) be
inserted on that pin to protect the external device and the BASIC Stamp.
2
Demo Program (POLINOUT.bsp)
p
' This program demonstrates the POLLIN, POLLOUT and POLLMODE commands. It
' will watch for a high signal on I/O pin 0 and then will output the opposite signal on I/O pin 1
' all while printing a message on the PC screen.
'{$STAMP BS2p}
Init:
POLLIN 0, 1
POLLOUT 1, 0
POLLMODE 2
Main:
DEBUG "Working...", BIN1 OUT2, CR
PAUSE 100
GOTO Main
'STAMP directive (specifies a BS2p)
'Set I/O pin 0 to polled-input looking for a high
'Set I/O pin 1 to polled-output; opposite level a 0
'Set mode to enable polled-outputs
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 229
'Waste time writing to PC screen

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents