Hi I use this code for getting available com ports from computer with C#
string[] ports = SerialPort.GetPortNames();
foreach (string port in ports)
{
comboBox1.Items.Add(port);
}
My question is that How can I get only Arduino port because I get all ports and I take exception on my desktop program. I want to take only arduino ports.
Usually something is sent to the available comport, and if the arduino is attached to that port and recognizes what is sent, ti would send a response back to the pc.
There may be a better way to do this by looking at attributes of the virtual COM port, but one approach is to look at the "Ports (COM & LPT)" class in the registry. This has a key for each COM port, and you could tell from the DriverDesc value whether this is a virtual COM port provided by the Arduino USB driver.