home *** CD-ROM | disk | FTP | other *** search
- 10 REM *******************************
- 20 REM * Basic robot control program *
- 30 REM * By Alan Foster *
- 40 REM * (c) Database Publications *
- 50 REM *******************************
- 60 CLS
- 70 OUT &H303,130:REM Set port A to output and port B to input
- 80 look=INP(&H301):REM Look at port B
- 90 done$=INKEY$
- 100 IF done$="q" THEN STOP
- 110 c=0
- 120 IF look<=128 THEN c=c
- 130 IF look>=128 THEN look=look-128:c=c+128
- 140 IF look<=64 THEN c=c
- 150 IF look>=64 THEN look=look-64:c=c+192
- 160 IF look<=32 THEN c=c
- 170 IF look>=32 THEN look=look-32:c=c+32
- 180 IF look<=16 THEN c=c
- 190 IF look>=16 THEN look=look-16:c=c+48
- 200 OUT &H300,c:REM Send result to port A
- 210 GOTO 50
-
-