Once in a while, if I upload a sketch to an Arduino board while my 3D printer is running, the 3D printer stops running, ruining the print job. I think that the Arduino IDE tries to upload sketches to 3D printer instead of Arduino board if the board and port are not set correctly in IDE. I have Arduino Uno, Mega 2560, and Micro boards, and Creality Ender 5 Plus printer. How can I fix the problems?
Buy a Raspbery Pi (3 or 4) install Octoprint connect the printer to the Pi instead of the PC. now you can print via a web interface, and your PC/AduinoIDE will never be confused about ports.