I have an Arduino Leonardo (pro micro), and when i'm uploading the program from the Arduino IDE to the board, the port changes automatically, so i have problems when testing my circuit. For example, i have selected the correct port so it says something like: Arduino Leonardo in COM4, the i hit upload program and when it finishes it changes the port so it says now: Arduino Leonardo in COM5.
Also i have tried changing the port of the USB connection and keeps happening.
I need to solve this problem, i have a project i need to build for a class and this keeps me from using the serial screen so i can't advance in the making of the project.
It is a common issue with the Leonardo and even the new MKR boards.
You can actually lock the com port though in XP up to win 8 so maybe you can still do it in win 10.
Hook up just your Leonardo.
- Control panel
- Device manager
- Expand PORTS
- Right click on the Leonardos port and select properties
- Select port settings tab
- Select advanced
- Select the port you want to assign to the Leonardo. Doesn't matter if its marked as in use and
you can ignore any message about that.
- Back out until you are in device manager again.
- I usually do a restart at this point.
Also dont forget the Leonardo needs the delay in the sketch for the serial port.
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB
}
}