5: BASIC Stamp Command Reference – POLLMODE
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 219
POLLMODE
BS1 BS2 BS2e BS2sx
BS2p
POLLMODE
Mode
Function
Specify a polled command mode.
•
Mode
is a variable/constant/expression (0 – 15) that indicates the
mode in which to process the polled command configuration.
Quick Facts
BS2p
Special notes
•
Polled-output pins will either change states continuously, just once or
not at all, depending on the POLLMODE command.
•
A poll-mode of 2 or 4 is required for a POLLWAIT command to work.
•
If both polled-outputs and polled-run are active, the polled-output event
will occur before the polled-run event.
Explanation
The POLLMODE command is one of a family of unique "polling"
commands on the BS2p module. The other commands in this family
include POLLIN, POLLOUT, POLLRUN and POLLWAIT. The
POLLMODE command is used to specify the mode in which polling
events and activities are processed. This activity will occur in-between
instructions during the rest of the PBASIC program.
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. The term "poll" comes from the fact that the
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".
This feature should not be confused with the concept of interrupts, as the
BASIC Stamp does not support true interrupts.
The POLLMODE command sets one of 15 possible modes for the polling
commands. It is used mainly before and/or after any POLLIN, POLLOUT
and POLLRUN commands to disable and enable the polling features as
desired. Table 5.56 shows the mode values and their effect.
Table 5.55: POLLMODE Quick
Facts.
p
2
Summary of Contents for BASIC Stamp 1
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...