文件名称:serial-communication
介绍说明--下载内容均来自于网络,请自行研究使用
VB实现pc与单片机串口通信任务
//利用vb实现pc与单片机串口通信任务
//编写程序代码
定义变量
Dim cnum As Integer 循环计数标志
Dim choosenum As Integer 选择指示灯号
串口初始化
在窗体的Load事件中加入下列代码对串口进行初始化
Private Sub Form_Load()
MSComm1.CommPort=1
MSComm1.InputMode=1
MSComm1.RThreshold=1
MSComm1.SThreshold=1
MSComm1.Settings="4800,n,8,1"
MSComm1.PortOpen=Ture
choosenum=1
End Sub-VB serial communication with the microcontroller to achieve the task pc
//Use pc with vb achieve single-chip serial communication tasks
//Write program code
Definition of variables
Dim cnum As Integer loop count mark
Dim choosenum As Integer Select Indicators
Serial port initialization
Add the following code in the form s Load event to initialize the serial port
Private Sub Form_Load ()
MSComm1.CommPort = 1
MSComm1.InputMode = 1
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1
MSComm1.Settings = "4800, n, 8,1"
MSComm1.PortOpen = Ture
choosenum = 1
End Sub
//利用vb实现pc与单片机串口通信任务
//编写程序代码
定义变量
Dim cnum As Integer 循环计数标志
Dim choosenum As Integer 选择指示灯号
串口初始化
在窗体的Load事件中加入下列代码对串口进行初始化
Private Sub Form_Load()
MSComm1.CommPort=1
MSComm1.InputMode=1
MSComm1.RThreshold=1
MSComm1.SThreshold=1
MSComm1.Settings="4800,n,8,1"
MSComm1.PortOpen=Ture
choosenum=1
End Sub-VB serial communication with the microcontroller to achieve the task pc
//Use pc with vb achieve single-chip serial communication tasks
//Write program code
Definition of variables
Dim cnum As Integer loop count mark
Dim choosenum As Integer Select Indicators
Serial port initialization
Add the following code in the form s Load event to initialize the serial port
Private Sub Form_Load ()
MSComm1.CommPort = 1
MSComm1.InputMode = 1
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1
MSComm1.Settings = "4800, n, 8,1"
MSComm1.PortOpen = Ture
choosenum = 1
End Sub
(系统自动生成,下载前可以参看下载内容)
下载文件列表
VB实现pc与单片机串口通信任务