Private Sub Command1_Click()
Dim outstring As String
Dim message As String, title As String, default As String
title = "输入窗口"
message = "请输入ASCII码字符"
default = "no input"
Cls
outstring = InputBox(message, title, default)
n = Len(outstring)
Print "outstringlength="; n
Call send(outstring, n)
End Sub
相应的单片机调试程序:
main()
{
inicom(); //初始化
while(1)
{
de=0;
while(RI==0);
RI=0;
de=1;
SBUF=0x56;
while(TI==0);
TI=0;
}
}
预计功能是通过vb送一个数据给单片机,单片机送0x56作为应答信号,但是单片机送来的是乱码,是不是通信过程中数据类型的问题啊,很急,在线等,望各位不吝赐教