CH12PR1.LST:

110 REM TWO LIGHT SENSOR TIMER PROGRAM
112 REM CALIBRATE BOTH SENSORS
115 FOR I=0 TO 1
120 PRINT "TURN ON FLASHLIGHT AND ADJUST THE"
130 PRINT "POTENTIOMETER ";I+1;" TILL THE MESSAGE JUST"
140 PRINT "CHANGES FROM OFF TO ON
150 PRINT :PRINT "PRESS X TO CONTINUE"
155 FOR J=1 TO 1000:NEXT J
160 A=STICK (0)
162 IF I=1 THEN 174
164 IF A=15 THEN PRINT "OFF"
166 IF A=13 THEN PRINT "OFF"
168 IF A=14 THEN PRINT "ON "
170 IF A=12 THEN PRINT "ON "
172 GOTO 190
174 IF A=15 THEN PRINT "OFF"
176 IF A=14 THEN PRINT "OFF"
178 IF A=13 THEN PRINT "ON "
180 IF A=12 THEN PRINT "ON "
190 REM CHECK IF X KEY PRESSED
200 IF PEEK(764)=22 THEN 220
210 GOTO 160
220 REM CLEAR LAST KEYSTROKE
230 POKE 764,255
240 NEXT I
250 PRINT "BREAK BEAM 1 TO START TIMER"
260 REM CHECK FIRST SENSOR TILL TRIGGERED
270 IF STICK(0)<>13 THEN 270
280 REM START TIMER
290 POKE 18,0:POKE 19,0:POKE 20,0
300 REM CHECK SECOND SENSOR UNTIL TRIGGERED
310 IF STICK(0)=14 THEN 320
315 GOTO 310
320 PRINT "TIME IS ";((PEEK(18)*255*255)+(PEEK(19)*255)+(PEEK(20)))/60;"SECONDS"

Back to previous page