求大神帮忙看一下这个关于VB和单片机串口通信的程序,
单片机代码#include <reg52.h>
#include<stdio.h>
void main()
{
SCON=0X40;
TMOD=0X20;
TH1=0XFD;
TL1=TH1;
EA=1;
TR1=1;
printf ("%s ","串口通信");
while(1);
}
VB代码:
Private Sub Form_Load()
= 3
MSComm1.Settings = "9600,n,8,1"
MSComm1.InputMode = comInputModeText
MSComm1.RThreshold = 1
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
If ( = comEvReceive) Then
Text1.Text = Text1.Text + MSComm1.Input
End If
End Sub