📄 lcd.frm
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1
Caption = "点阵字符型液晶显示编程 苏州大学freescale MCU&DSP研发中心 2005年3月版"
ClientHeight = 4200
ClientLeft = 2490
ClientTop = 2880
ClientWidth = 10410
Icon = "lcd.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4200
ScaleWidth = 10410
Begin MSCommLib.MSComm MSComm1
Left = 2100
Top = 2880
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.Frame Frame1
Caption = "请在此输入要显示的字符:"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3135
Left = 450
TabIndex = 0
Top = 540
Width = 9465
Begin VB.CommandButton Command1
Caption = "退 出"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 1
Left = 5250
TabIndex = 3
Top = 1890
Width = 1635
End
Begin VB.CommandButton Command1
Caption = "发送数据"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 645
Index = 0
Left = 2550
TabIndex = 2
Top = 1890
Width = 1665
End
Begin VB.TextBox Text1
BackColor = &H00C0E0FF&
BeginProperty Font
Name = "隶书"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 675
Left = 180
TabIndex = 1
Top = 720
Width = 9015
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer '临时使用
Dim senddata(31) As Byte '发送数据数组
Private Sub Form_Load() '初始化
'串行口初始化
Call SCIinit(MSComm1, 1, "9600,N,8,1")
Text1.MaxLength = 32 '输入框限制32个字符
End Sub
Private Sub Command1_click(Index As Integer)
Select Case Index
Case 0 '单击“发送数据”命令按钮
For i = 1 To Len(Text1.Text) '给senddata数组赋值
senddata(i - 1) = Asc(Mid(Text1.Text, i, 1)) '把Text1给senddata
Next i
If Len(Text1.Text) < 32 Then '不足部分补空格
For i = Len(Text1.Text) To 31
senddata(i) = 32
Next i
End If
MSComm1.Output = senddata '发送出去
Case 1 '单击“退出”命令按钮
MSComm1.PortOpen = False '关闭
End
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -