REM $INCLUDE: '7188.bi' REM $INCLUDE: 'printf.bas' CALL InitLib ' driver initial CALL Init5DigitLed ' 5-digit LED initial port% = 3 temp% = InstallCom(port%, 57600, 8, 0, 1) open "STDOUT" for output as #1 FOR i% = 0 TO 16 IF (i% = 16) THEN i% = 0 CALL LedOn ' turn LED on j% = ReadInitPin ' read INIT* pin ' tmp% = printf(port%, CHR$(10) + CHR$(13) + "Led Is On,INIT* pin is ") tmp% = print3( CHR$(10) + CHR$(13) + "Led Is On,INIT* pin is ") IF (j% = 1) THEN tmp% = printf(port%, "Not Open") ELSE tmp% = printf(port%, "Open") END IF temp% = Show5DigitLed(1, j%) ' show to 5-digit LED FOR j% = 2 TO 5 temp% = Show5DigitLed(j%, i%) NEXT j% CALL Delay(500) CALL LedOff ' turn LED on j% = ReadInitPin ' read INIT* pin tmp% = printf(port%, CHR$(10) + CHR$(13) + "Led Is Off , INIT* pin is ") IF j% = 1 THEN tmp% = printf(port%, "Not Open") ELSE tmp% = printf(port%, "Open") END IF temp% = Show5DigitLed(1, j%) ' show to 5-digit LED CALL Delay(500) check: temp% = IsCom(port%) 'kbhit4 IF (temp% <> 0) THEN ' check user keyboard j% = ReadCom(port%) 'getch4 ' get user's key-in IF ((j% = ASC("q")) OR (j% = ASC("Q"))) THEN EXIT FOR 'return to ROM-DOS tmp% = ToCom(port%, ASC("(")) tmp% = ToCom(port%, j%) tmp% = ToCom(port%, ASC(")")) print #1,12 GOTO check END IF NEXT i% CLOSE #1 temp% = RestoreCom(port%)