Any have an idea of how to use the USB port in VB.net? I want to make a ground station for my UAV (I would like to build it myself...), but I can't figure out the USB connection. I'VE SEARCHED EVERYWHERE!!! Any have ideas???Thanks a bunch!Sam R.
You need to be a member of diydrones to add comments!
Ok, I have this code.
Button 1 lists available serial ports. Button 2 sends a string to the serial port whose name is recorded in me.textbox1.text
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each sp As String In My.Computer.Ports.SerialPortNames
ListBox1.Items.Add(sp)
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
' Send strings to a serial port.
Using com1 As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort(Me.TextBox1.Text.tostring)
com1.WriteLine("bla")
End Using
End Sub
End Class
But I can only use one serial connection to a computer. (I only have 1 serial in-port on my PICAXE). On USB I think there is 4 or 5 outputs from USB and I can't use all of them. How can I limit the serial sending to only one wire?
Sam R.
Replies
http://www.codeworks.it/net/VBNetRs232.htm
Button 1 lists available serial ports. Button 2 sends a string to the serial port whose name is recorded in me.textbox1.text
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each sp As String In My.Computer.Ports.SerialPortNames
ListBox1.Items.Add(sp)
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
' Send strings to a serial port.
Using com1 As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort(Me.TextBox1.Text.tostring)
com1.WriteLine("bla")
End Using
End Sub
End Class
But I can only use one serial connection to a computer. (I only have 1 serial in-port on my PICAXE). On USB I think there is 4 or 5 outputs from USB and I can't use all of them. How can I limit the serial sending to only one wire?
Sam R.