⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appnt1.bas

📁 82 sample programs written in BASCOM-8051 for 8051 developement
💻 BAS
字号:
'----------------------------------------------------------
'                (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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -