{\rtf1\ansi\ansicpg1252\deff0\deflang2070{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}} \viewkind4\uc1\pard\sb100\sa100\f0\fs24 NEW \par \line\line ***** \line\line NEW 10 REM Test Program Four 11 REM Walking Program for BORIS Connected to PC Parallel Port 12 REM Control from numeric keypad: UP arrow = Forward, etc. 13 REM 14 REM Send bits to the parallel port with LPRINT CHR$(Bits); 15 REM 16 REM Bits = 1*n + 2*n + 4*n + 8*n + 16*n + 32*n + 64*n + 128*n 17 REM 18 REM Bits equation sets bits ON if n = 1 or OFF if n = 0 19 REM First position (1*n) is bit 0 20 REM Last position (128*n) is bit 7 21 REM Calculate with each n to 1 or 0 for other output patterns 22 REM 23 REM Note: Ending semicolon (;) on LPRINT command holds 24 REM bit pattern at parallel port until next LPRINT 25 REM 30 DELAY = 350: REM Increase for slower walk, decrease for faster 40 PRINT "Press keypad arrow keys for Fwd, Back, Left, Right" 50 PRINT "Press space bar for Stop" 60 PRINT "Press Q at any time to Quit" 100 REM Stop walking 110 LPRINT CHR$(0); : GOSUB 1000: REM Clear All Bits 120 GOTO 100 200 REM Walk Forward 210 LPRINT CHR$(65); : GOSUB 1000: REM Bit 6, 0 ON 220 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON 230 LPRINT CHR$(130); : GOSUB 1000: REM Bit 7, 1 ON 240 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON 250 GOTO 200 300 REM Walk Reverse 310 LPRINT CHR$(65); : GOSUB 1000: REM Bit 6, 0 ON 320 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON 330 LPRINT CHR$(130); : GOSUB 1000: REM Bit 7, 1 ON 340 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON 350 GOTO 300 400 REM Rotate Left 410 LPRINT CHR$(66); : GOSUB 1000: REM Bit 6, 1 ON 420 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON 430 LPRINT CHR$(129); : GOSUB 1000: REM Bit 7, 0 ON 440 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON 450 GOTO 400 500 REM Rotate Right 510 LPRINT CHR$(66); : GOSUB 1000: REM Bit 6, 1 ON 520 LPRINT CHR$(4); : GOSUB 1000: REM Bit 2 ON 530 LPRINT CHR$(129); : GOSUB 1000: REM Bit 7, 0 ON 540 LPRINT CHR$(32); : GOSUB 1000: REM Bit 5 ON 550 GOTO 500 1000 REM Check Key Press and Do Delay Loop 1010 A$ = INKEY$ 1020 IF A$ = " " THEN PRINT "Stop": LPRINT CHR$(0); : GOTO 100 1030 IF A$ = CHR$(0) + "H" THEN PRINT "Forward": LPRINT CHR$(0); : GOTO 200 1050 IF A$ = CHR$(0) + "P" THEN PRINT "Reverse": LPRINT CHR$(0); : GOTO 300 1060 IF A$ = CHR$(0) + "K" THEN PRINT "Left" : LPRINT CHR$(0); : GOTO 400 1070 IF A$ = CHR$(0) + "M" THEN PRINT "Right" : LPRINT CHR$(0); : GOTO 500 1080 IF A$ = "Q" OR A$ = "q" THEN LPRINT CHR$(0); : END 1100 FOR I = 1 TO DELAY 1110 NEXT I 1120 RETURN 1900 END \line\line RUN\par \pard\f1\fs20\par }