Hi there, I am making a project with my Arduino pro micro. To make it simple, I'm making a keyboard that can be reconfigured by a user interface on a computer.
On my Arduino, I activate the keyboard.h, Keyboard.begin(); and Serial.begin(9600); All I'm doing is reading the incoming messages on the COM port and do actions depending on the received message.
With only "keyboard.h, Keyboard.begin(); and Serial.begin(9600);" , the Arduino is on the COM Port 26. Using AutoHotKey, I connected to the COM Port 26 and then send my messages to the Arduino. Everything works flawlessly.
The problem is the following
I want to add a way to move the mouse with the keyboard too.
Once I add Mouse.h and Mouse.begin(); The com port switches from COM26 to COM9. There is absolutely NO WAY to connect to COM9 using AHK and I don't know why...
TLDR; Without Mouse.h, My arduino is set to COM26. Once Mouse.h is added, My arduino is set to COM9 which doesn't work with AHK idk why.
Well my question is mostly, is there a way to not change the COM Port automatically once mouse.h is included ?
And it's not just an AHK question, Try it with a serial analyzer. You can't connect to an Arduino Pro Micro that has a mouse enabled but keyboard you can
DrAzzy:
When you include Mouse.h, it projects as a different composite USB device, so it will be assigned a different COM port number.
I think you can reassign the com port numbers in Device Manager (though I haven't done this, at least not recently).
Ohhh I understand now, I plan on selling these devices to people. If I change the COM Port on my computer, do you think the arduino device will keep that COM# when plugged into another computer?