VB可以直接发送字模数组到51单片机吗
我用VB 编了任意汉字取模程序,并使用了串口MSCOMM控件。怎么把我取到的字模数组发送给单片机?需要用定时器控件吗?求大牛指点、 Comport.Output = “字符串” 就是单片机串口通讯。按行发送、接收到可以按行显示,速度呢,就看情况了 二进制方式参考:
With Form1.MSComm1
If .PortOpen = False Then
.InputLen = 0 '从接收区中读出的字符数
.InBufferSize = 1024
.OutBufferSize = 1024
.SThreshold = 1 '传输中允许的最小字符数
.RThreshold = 1 '接受的字符数
.InputMode = comInputModeBinary '二进制接收
End If
'.CommPort = 1
'.Settings = "9600,n,8,1"
End With
Dim out() As Byte
ReDim out(1 To cnt )'数组长度为cnt
If MSComm1.PortOpen = True Then
out(1) = &HAA
out(2) = &H55
.....
MSComm1.Output = out
end if
页:
[1]