Table of Contents

Advertisement

Table 5.53: POLLIN Quick Facts.
5: BASIC Stamp Command Reference – POLLIN

POLLIN

BS1
2
POLLIN Pin, State
p
Function
Specify a polled-input pin and active state.
• Pin is a variable/constant/expression (0 – 15) that specifies the I/O
pin to use. This I/O pin will be set to input mode.
• State
is a variable/constant/expression (0 – 1) that specifies
whether to poll the I/O pin for a low (0) or a high (1) level.
Quick Facts
Available
1) Nothing,
actions in
2) Set polled-output pins to a specified state,
response to
3) Run another program (in a specified program-slot),
reaching the
4) Wait (pause program execution) until desired State is reached,
5) Any combination of 2, 3 and 4, above.
desired State
• The polled-input pins are monitored (polled) in-between each command
within the PBASIC code.
• On the BS2p40, polled-input pins can be defined on both Main I/O and
Special notes
Aux I/O pins. These are all active regardless of which group the
program happens to be using at the time of a polling event.
Explanation
The POLLIN command is one of a family of unique "polling" commands
on the BS2p module.
POLLMODE, POLLOUT, POLLRUN and POLLWAIT.
command is used to specify an input pin to monitor, or "poll", in-between
instructions during the rest of the PBASIC program. The BASIC Stamp
will then perform some activity (in-between instructions) when the
specified State is detected.
POLLMODE, POLLOUT and POLLRUN commands.
The "polling" commands allow the BASIC Stamp to respond to certain I/O
pin events at a faster rate than what is normally possible through manual
PBASIC programming.
BASIC Stamp's interpreter periodically checks the state of the designated
polled-input pins. It "polls" these pins after the end of each PBASIC
command and before it reads the next PBASIC command from the user
program; giving the appearance that it is polling "in the background".
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 215
BS2
BS2e BS2sx
BS2p
BS2p
The other commands in this family include
The activity performed depends on the
The term "poll" comes from the fact that the
The POLLIN

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