Private Sub cmdsent_Click() Dim strsent As String strsent = txtsent.Text 'txtsent文本框内填写需发送的 0或者1或者2 MsComm1.Output = strsent End SubPrivate Sub Form_Load() With MsComm1 .InBufferSize = 5120 .CommPort = 1 .Settings = "9600,N,8,1" '设置好单片机所需的串口设置参数 .RThreshold = 0 .PortOpen = True End With End Sub
Dim strsent As String
strsent = txtsent.Text 'txtsent文本框内填写需发送的 0或者1或者2
MsComm1.Output = strsent
End SubPrivate Sub Form_Load()
With MsComm1
.InBufferSize = 5120
.CommPort = 1
.Settings = "9600,N,8,1" '设置好单片机所需的串口设置参数
.RThreshold = 0
.PortOpen = True
End With
End Sub