I’m using an Arduino with the Firmata library for communication to a C# application, and I want to eliminate a COM port configuration component since it can change from machine to machine…
Is it possible to:
- Enumerate list of COM ports in the system? (In my googling I’ve seen some fairly ugly Win32 API code, hoping there’s maybe a cleaner version now)
- Auto-detect which COM port(s) are connected to an Arduino?
This little bit of code has performed very well for this (returns the COM port string, i.e. “COM12” if Arduino is detected):