POLLIN - BASIC Stamp Command Reference
Page 218
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
pins 2 and 3 low. This works similar to a logical OR operation. The truth
table below shows all the possible states of these two polled-input pins
and the corresponding states the BASIC Stamp will set the polled-output
pins to.
Normally, any polled-output pins reflect the state changes continuously,
as described above. The POLLMODE command supports another feature,
however, where the polled-output pins will latch the active state; they will
change only once (when the poll state is reached) and stay in the new state
until the PBASIC program tells it to change again. See the POLLMODE
description for more information.
Other possible actions in response to polled-input states are: 1) Running
another program (in a specified program slot), 2) Waiting (pausing
program execution with or without low-power mode) until the poll state is
reached, or 3) Any combination of the above-mentioned actions.
Demo Program (POLINOUT.bsp)
' This program demonstrates the POLLIN, POLLOUT and POLLMODE commands. It
' will watch for a high signal on I/O pin 0 and then will output the opposite signal on I/O pin 1
' all while printing a message on the PC screen.
'{$STAMP BS2p} 'STAMP directive (specifies a BS2p)
Init:
POLLIN 0, 1 'Set I/O pin 0 to polled-input looking for a high
POLLOUT 1, 0 'Set I/O pin 1 to polled-output; opposite level a 0
POLLMODE 2 'Set mode to enable polled-outputs
Main:
DEBUG "Working...", BIN1 OUT2, CR 'Waste time writing to PC screen
PAUSE 100
GOTO Main
Polled-Inputs
Polled-Outputs
0
1
2
3
0
0
1
1
0
1
0
0
1
0
0
0
1
1
0
0
P
OLLED
-
OUTPUTS CAN BE
"
LATCHED
"
ALSO
.
Table 5.54: Polled-Inputs /
Polled-Outputs Truth Table.
p
2
Содержание 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...