110 REM ALARM PROGRAM 120 PRINT "TURN ON FLASHLIGHT AND ADJUST THE" 130 PRINT "POTENTIOMETER TILL THE MESSAGE JUST " 140 PRINT "CHANGES FROM OFF TO ON� 150 PRINT "PRESS X TO CONTINUE" 155 FOR J=1 TO 2500:NEXT J 160 IF STICK(1)=1 THEN PRINT "OFF� 170 IF STICK(1)=0 THEN PRINT "ON � 180 REM CHECK IF X KEY PRESSED 190 IF PEEK(764)=22 THEN 210 200 GOTO 160 210 REM CLEAR OUT LAST KEYSTROKE 220 POKE 764,255 230 PRINT "TRIGGER A SENSOR TO ST ART ALARM" 240 A=STICK(1):B=STRIG(1) 250 IF (A=0 AND B=0) THEN 240 260 PRINT "WARNING - ALARM TRIGGERED" 270 IF A=1 THEN PRINT "SENSOR 1" 280 IF A=2 THEN PRINT "SENSOR 2" 290 IF A=4 THEN PRINT "SENSOR 3" 292 IF A=8 THEN PRINT "SENSOR 4" 294 IF B=1 THEN PRINT "SENSOR 5" 300 PRINT "DETECTS VIOLATION" 305 REM INITIALIZE CLOCK 310 POKE 18,0:POKE 19,0:POKE 20,0 320 REM SET DATA LINES FOR OUTPUT 330 POKE 54018,48 340 POKE 54016,255 350 POKE 54018,52 360 REM SET DATA LINES LOW TO TURN ON ALARM 370 POKE 54016,0 380 IF ((PEEK(18)*255*255)+(PEEK( 19)*255)+(PEEK(20)))>3600/24 THEN 400 390 GOTO 380 400 REM TURN OFF ALARM BY SETTING DATA LINES LOGIC HIGH 410 POKE 54016,255 420 REM RESET DATA LINES FOR INPUT 430 POKE 54018,48 440 POKE 54016,0 450 POKE 54018,52
Back to previous page