-1
我想編輯我發現的開源代碼,那裏有一些錯誤,無論如何,我解決了一切,但我仍然有這個: 我把一個組合下拉菜單,下拉菜單在串口之間選擇與arduino進行通信,但是如果我選擇了其他端口,程序選擇COM5似乎總是如此。 這是錯誤我有當我按下啓動按鈕,溝通VB.net選擇串口System.IO.IOException
An unhandled exception of type 'System.IO.IOException' occurred in System.dll
Additional information: The port 'COM5' does not exist.
,這是組合下拉菜單代碼
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs)
Handles ComboBox1.SelectedIndexChanged
End Sub
與此代碼爲啓動按鈕
Private Sub Button7_Click(sender As System.Object, e As System.EventArgs)
Handles Button7.Click
SerialPort1.Open()
SerialPort1.Write("~")
SerialPort1.Write("LCD is working!")
Timer2.Start()
SerialPort1.Close()
End Sub