Go Down

Topic: Connecting 1 Arduino to 2 computers (Read 104 times) previous topic - next topic



My project includes a laptop, a desktop computer and one Arduino. My laptop gathers and processes data that needs to be sent to the Arduino which then needs to simulate mouse movement on the desktop computer accordingly to the data received. What would be the best way to connect all of this together, and which components would be required?

So far I've been using a Pro Micro for a similar project where only a single computer was required. I was running a C++ program which gathered data and sent it over the COM port to Pro Micro which then simulated mouse movement on the same PC simultaneously.

Really scratching my head about this new project though. I've been searching for an Arduino with 2 micro USB ports and a mouse emulation capability but nothing comes up. If I buy a Leonardo can I send data to it over the ethernet port and have the USB cable connected to my desktop?

Help is really appreciated!


An Arduino Due has two USB ports. It can do this.

It is not a good idea to plug two different computers in at the same time. Their grounds may be different and there may be a lot of current flowing in the ground wire of the USB cable as a result. If you can run the laptop on its battery while the two are connected like this it will be much safer.
"The problem is in the code you didn't post."


Couple of other things you could investigate :

1. Software serial- having multiple con ports on a UNO/nano etc.
2. Opto isolators and isolated coms ( google) ; to remove any possible grounding issues

Go Up