5: BASIC Stamp Command Reference – POLLRUN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 231
POLLRUN
BS1 BS2 BS2e BS2sx
BS2p
POLLRUN
Slot
Function
Specify a program to run upon a polled-input event.
•
Slot
is a variable/constant/expression (0 – 7) that specifies the
program slot to run when a polled-input event occurs.
Quick Facts
BS2p
Default Slot
The default polled-run slot is 0. If no POLLRUN command is given and a
poll mode of 3 or 4 is set, the program in slot 0 will run in response to a
polled-input event.
Special notes
•
If both polled-outputs and polled-run are active, the polled-output event
will occur before the polled-run event.
Explanation
The POLLRUN command is one of a family of unique "polling" commands
on the BS2p module. The other commands in this family include POLLIN,
POLLMODE, POLLOUT and POLLWAIT. The POLLRUN command is
used to specify a program slot to run in response to a polled event. This
activity can occur in-between any two instructions within 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 following is a simple example of the POLLRUN command.
Table 5.59: POLLRUN Quick Facts.
p
2
A
SIMPLE
POLLRUN
EXAMPLE
.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...