5: BASIC Stamp Command Reference – POLLRUN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 233
Demo Program (POLLRUN0.bsp)
' This program demonstrates the POLLRUN command. It is intended to be downloaded
' to program slot 0, and the program called PROGRUN1.BSP should be downloaded to
' program slot 1. I/O pin 0 is set to watch for a high signal. Once the Loop routine
' starts running, the program constant prints it's program slot number to the screen. If I/O
' pin 0 goes high, the program in program slot 1 (which should be POLLRUN1.BSP) is run.
'{$STAMP BS2p, PollRun1.bsp} 'STAMP directive (specifies a BS2p)
ProgSlot VAR BYTE
Init:
POLLIN 0, 1 'Set I/O 0 to polled-input looking for a high
POLLRUN 1 'Set polled-run to program slot 1
POLLMODE 3 'Set mode to enable polled-outputs and polled wait
Loop:
GET 127, ProgSlot
DEBUG "Running Program #", DEC ProgSlot.LOWNIB, CR
GOTO Loop
Demo Program (POLLRUN1.bsp)
' This program demonstrates the POLLRUN command. It is intended to be downloaded
' to program slot 1, and the program called PROGRUN0.BSP should be downloaded to
' program slot 0. This program is run when program 0 detects a high on I/O pin 0
' via the polled commands.
ProgSlot VAR BYTE
Loop:
GET 127, ProgSlot
DEBUG "Running Program #", DEC ProgSlot.LOWNIB, CR
GOTO Loop
p
2
p
2
Summary of Contents for BASIC Stamp 2e
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...