appnt1.bas

来自「82 sample programs written in BASCOM-805」· BAS 代码 · 共 35 行

BAS
35
字号
'----------------------------------------------------------
'                (c) 1997-2000 MCS Electronics
'                  APPLICATION NOTE 1
'               RS-232 / LCD interface
'----------------------------------------------------------
'This sample shows how to manipulate a LCD-display via
'the RS-232 interface.
'Commands are sent as numbers above 127
'Characters are sent as usually
'Use the evaluation board to test it.

'----------------------------------------------------------------
'You can use a simple routine in QuickBasic to send commands/characters to the display
'OPEN "COM1:4800,N,8,1" FOR OUTPUT as #1
'PRINT #1, chr$(128)
'PRINT#1,"Hello"
'CLOSE #1
'----------------------------------------------------------------
Dim K As Byte                           'dim byte

Do                                      'start
  K = Inkey()                             'get character
  If K = 128 Then
     Cls                                'clear LCD
  Elseif K = 129 Then
     Home                               'HOME LCD
  Elseif K = 130 Then
     Display On                         'display on
  Elseif K = 131 Then
     Display Off                        'display off
  Elseif K <> 0 Then                    'not a command
     Lcd Chr(k);                        'convert it to a character and print it
  End If
Loop                                    'loop for ever
End

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?