POLLMODE - BASIC Stamp Command Reference
Page 222
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
acts just like it did initially for the remainder of the program. The ability
to temporarily disable polling, without changing the configuration, can be
a powerful feature for certain "critical" parts of a program.
The following example contains two programs. The first should be
downloaded into program slot 0 and the second into program slot 1. We'll
assume they are called POLL0.bsp and POLL1.bsp, respectively (as
defined in the STAMP directive lines).
' ----- program #1 (slot 0) -----
' {$STAMP BS2p, POLL1.bsp}
POLLIN 0, 1
POLLOUT 1, 1
POLLRUN 1
POLLMODE 4
Loop:
DEBUG "Program 1", CR
GOTO Loop
' ----- program #2 (slot 1) -----
' {$STAMP BS2p}
DEBUG "Switching…", CR
Loop:
DEBUG "Program 2", CR
GOTO Loop
In this example (containing two programs; one is slot 0 and the other in
slot 1) program 1 (slot 0) will configure polled-input pin 0 to detect a high
state and polled-output 1 to go high in response. Program 1 also
configures a polled-run activity (see the POLLRUN description for more
information) to run the program in slot 1. The POLLMODE setting
activates the polled-output and the polled-run. Then, program 1
continuously prints "Program 1" on the PC screen.
Once I/O pin 0 goes high, however, the BASIC Stamp will set I/O pin 1
high, then execution will be switched to the program in slot 1 (program 2).
Program 2 will first print "Switching…" on the PC screen and then will
continuously print "Program 2". From this point forward, I/O pin 1 will
continue to be set low and high in response to changes occurring on I/O
Содержание 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...