CSC270 Persistent Name for Serial Port
Referenced from: Persistent Names for USB-Serial Devices
First, we found the Vendor ID and Product ID through the command lsusb.
Then, the serial number.
We then created the file "99-usb-serial.rules" in the directory /etc/udev/rules.d with the following text:
After that, we could replace /dev/ttyACM0 in the code with /dev/arduino and solved the problem of the changing serial port.