POLLWAIT - BASIC Stamp Command Reference
Page 236
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
The POLLWAIT command is unique among the polling commands in that
it actually causes execution to halt, until a polled-input pin event occurs.
The Period argument is similar to that of the NAP command; using the
values 0 to 7 specifies the duration of the low-power period. After the
low-power period is over, the BASIC Stamp polls the polled-input pins
and determines if any meet the desired poll state. If no polled-input is in
the desired state (as set by POLLIN command) the BASIC Stamp goes
back into low-power mode, again, for the same duration as before. If any
polled-input is in the desired state, however, the BASIC Stamp will
continue execution with the next line of code.
A Period of 8, makes the BASIC Stamp pause execution in normal running
mode (not low-power mode) until a polled-input event occurs. The
response time is indicated in Table 5.60.
Since the response time is so fast,
this feature can be used to synchronize a portion of PBASIC code to an
incoming pulse.
Period
Length of Low-Power Mode
0
18 ms
1
36 ms
2
72 ms
3
144 ms
4
288 ms
5
576 ms
6
1152 ms (1.152 seconds)
7
2304 ms (2.304 seconds)
8
No power-down
The following is a simple example of the POLLWAIT command.
POLLIN 0, 1
Loop:
POLLWAIT 0
TOGGLE 1
GOTO Loop
In this example, the POLLIN command sets I/O pin 0 to be a polled-input
pin looking for a high (1) state. The Loop routine immediately runs a
POLLWAIT command and specifies a Period of 0 (with results in a low-
power state of 18 ms). This means that every 18 ms, the BASIC Stamp
wakes-up and checks I/O pin 0 for a high. If I/O pin 0 is low, it goes back
A
SIMPLE
POLLWAIT
EXAMPLE
.
Table 5.61: Period values and
associated low-power modes.
Содержание BASIC Stamp 1
Страница 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...