CH12PR2.LST:

100 REM LIGHT SWITCH
110 REM
120 PRINT "SET LIGHT LEVEL TO SWITCH ON"
130 PRINT "PRESS X TO CONTINUE"
140 A=PADDLE(0)
150 REM CHECK IF X KEY PRESSED
160 IF PEEK(764)=22 THEN 180
170 GOTO 140
175 REM CLEAR LAST KEYSTROKE
180 POKE 764,255
190 PRINT "SET LIGHTING LEVEL TO SWITCH OFF"
200 PRINT "PRESS X TO CONTINUE"
210 B=PADDLE(0)
220 REM CHECK IF X KEY PRESSED
230 IF PEEK(764)=22 THEN 260
240 GOTO 210
250 REM CLEAR LAST KEYSTROKE
260 POKE 764,255
262 PRINT :PRINT "PRESS X TO START"
264 IF PEEK(764)=22 THEN 268
266 GOTO 264
268 POKE 764,255
270 REM CHECK IF LIGHT LEVEL LOWER THAN FIRST SETTING
280 IF PADDLE(0)<A THEN 280
290 REM SET DATA DIRECTION REGISTER FOR OUTPUT
300 POKE 54018,48
310 POKE 54016,255
320 POKE 54018, 52
330 REM SET DATA LINES LOGIC LOW
340 POKE 54016,0
350 REM CHECK IF LIGHTING LEVEL HIGHER THAN SECOND SETTING
370 IF PADDLE(0)>B THEN 370
380 REM SET DATA LINES LOGIC HIGH
390 POKE 54016, 255
400 REM RESET DATA LINES FOR INPUT
410 POKE 54018,48
420 POKE 54016,0
430 POKE 54018,52

Back to previous page