BASIC stamp manual v2.2
POLLMODE – BASIC Stamp Command Reference
Page 324 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
Setup:
POLLIN FDoor, 0 ' define alarm inputs
POLLIN BDoor, 0
POLLIN Patio, 0
POLLOUT AlarmLed, 1 ' alarm indicator
POLLMODE 10 ' activate latched polling
DEBUG CLS,
"Alarms Activated", CR
Main:
DO
DEBUG "." ' foreground activity
PAUSE 50
LOOP UNTIL (AlarmLed = 1) ' loop until LED is on
GET 128, alarms ' get alarm bits
POLLMODE 0 ' deactivate polling
Report:
DEBUG CLS, ' alarms report
"Front Door : ", CR,
"Back Door : ", CR,
"Patio : ", CR
FOR idx = 0 TO 2 ' scan alarm bits
DEBUG CRSRXY, 13, idx ' move cursor
IF (alarms.LOWBIT(idx)) THEN ' report each bit status
DEBUG "Alarm", CR
ELSE
DEBUG "-", CR
ENDIF
NEXT
DEBUG CR, "Press RESET to clear..."
DO : LOOP UNTIL (Rst = 0) ' wait until Rst pressed
GOTO Setup
END