Find the Arduino Computer USB Serial Port Name / Number Programmatically using Processing

In this article, a program written in the Processing language is used to determine which port the Arduino or other USB serial device is plugged into on the computer. The article contains the source code for the sketch which can be run on Linux, Windows and Mac.

The application waits for the Arduino to be plugged into a spare USB port on the PC and then notifies the user what the port name is with a message in the application window.