dim c as byte dim a as long dim b as byte dim d as byte dim mask as byte comm.port=2 comm.baud=4800 comm.parity="NONE" comm.data=8 comm.stop=1 comm.OPEN IF comm.err THEN GOTO 30 CLS PRINT "A - hello message" PRINT "B - hello message" PRINT "C - hello message" PRINT "D - hello message" PRINT "E - hello message" PRINT "F - party" PRINT "G - dance" PRINT "H - dance" PRINT "I - sneeze" PRINT "J - sing, burp" PRINT "K - laugh, joke, tickle" PRINT "L - sing twinkle, twinkle" PRINT "M - yawn, hide" PRINT "N - hide" PRINT "O - feeling sleepy" PRINT "P - Go to sleep now" 11 c=inkey() IF c=0 THEN GOTO 11 PRINT chr(c); c=c and 0x1f c-=1 IF c>0x0f THEN GOTO 11 FOR b=1 TO 6 comm.putbyte(0xef) IF c and 0x01 THEN GOSUB sendone ELSE GOSUB sendzero END IF IF c and 0x02 THEN GOSUB sendone ELSE GOSUB sendzero END IF IF c and 0x04 THEN GOSUB sendone ELSE GOSUB sendzero END IF IF c and 0x08 THEN GOSUB sendone ELSE GOSUB sendzero END IF IF c and 0x01 THEN GOSUB sendzero ELSE GOSUB sendone END IF IF c and 0x02 THEN GOSUB sendzero ELSE GOSUB sendone END IF IF c and 0x04 THEN GOSUB sendzero ELSE GOSUB sendone END IF IF c and 0x08 THEN GOSUB sendzero ELSE GOSUB sendone END IF FOR a=1 TO 500 NEXT a NEXT b GOTO 11 END sendone: comm.putbyte(0xef) rem PRINT "1"; RETURN sendzero: comm.putbyte(0xff) rem PRINT "0"; RETURN 30 PRINT "error "; PRINT comm.err END PROG