5: BASIC Stamp Command Reference – POLLIN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 215
POLLIN
BS1 BS2 BS2e BS2sx
BS2p
POLLIN
Pin, State
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
BS2p
Available
actions in
response to
reaching the
desired State
1) Nothing,
2) Set polled-output pins to a specified state,
3) Run another program (in a specified program-slot),
4) Wait (pause program execution) until desired State is reached,
5) Any combination of 2, 3 and 4, above.
Special notes
•
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
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. The other commands in this family include
POLLMODE, POLLOUT, POLLRUN and POLLWAIT. The POLLIN
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. The activity performed depends on the
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. 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".
Table 5.53: POLLIN Quick Facts.
p
2
Содержание 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...