REM This program is for checking the serial Tablet REM If you want to chenge com port or baud rate,you should change the REM Open statement (Other command test programs also the same REM When you use this program, if tip switch dosen't work propary, plese try REM Phase Adjust(See Programming manual's Phase Adjust section) REM Scale factors for 640x480 screen rx = 640 / 3880 ry = 480 / 2920 OPEN "com1:19200,n,8,1,RS,DS0" FOR RANDOM AS #1 LEN = 5000 SCREEN 11 CLS LOCATE 1, 50 PRINT "Press side switch to exit" REM Send 15ms interval and start data commands PRINT #1, "3" FOR i = 0 TO 3000: NEXT i PRINT #1, "4" FOR i = 0 TO 1000: NEXT i dataLoop: REM make sure first byte has sync bit set a1 = ASC(INPUT$(1, #1)): IF (a1 AND &H80) <> &H80 THEN GOTO dataLoop REM get the rest of the data packet if in sync a2 = ASC(INPUT$(1, #1)): a3 = ASC(INPUT$(1, #1)) a4 = ASC(INPUT$(1, #1)): a5 = ASC(INPUT$(1, #1)) a6 = ASC(INPUT$(1, #1)): a7 = ASC(INPUT$(1, #1)) sw = a1 AND &H7 er = (sw AND &H4) / 4 ph = a6 * 2 + ((a7 AND &H10) / 16) x0 = (a2 * 128 + a3) y0 = (a4 * 128 + a5) IF x0 < 10 AND y0 < 10 THEN CLS LOCATE 1, 1 PRINT "X = "; x0 LOCATE 1, 10 PRINT " Y = "; y0 LOCATE 1, 20 PRINT " Pressure = "; ph LOCATE 1, 37 IF er = 0 THEN PRINT "Tip " ELSE PRINT "Eraser" IF ph > 5 THEN PSET (x0 * rx, y0 * ry) IF (sw AND &H2) = 0 GOTO dataLoop