I have a Leonardo running a capacitive touch script. The arduino is connected to a steel handle that then translates the signal to a keyboard #1 press.
The #1 press is interpreted by software on my computer to run a video. However, I have this same script running on 3 total computers, because of limitations I have with some digital displays.
Those hubs do not split a single USB signal into 4. They allow 4 separate devices to connect via a single USB socket.
USB is a very complex system. When a device communicates over USB it is a two-way "paired" conversation. I can't imagine how one Leonardo could have a two-way conversation with 3 PCs at the EXACT same time - especially as the Leonardo is only sending out one channel of conversation.
In a normal arrangement the PC is the master and the Leonardo / keyboard is the slave. If you connect 3 PCs there would be 3 masters - it can't happen.
I'd use Ethernet or WiFi and then one Arduino can communicate with all your computers through the network. And then use an application on the computers to interpret the network communication.
pert:
I'd use Ethernet or WiFi and then one Arduino can communicate with all your computers through the network. And then use an application on the computers to interpret the network communication.
I had though of something like that but it is difficult (if not impossible) to emulate a keyboard that way. There could also be latency problems.
With 3 Leonardos (or equivalents) it would be easy to arrange communication between them or between them and a master Arduino.
Robin2:
it is difficult (if not impossible) to emulate a keyboard that way.
Not at all. You just need an application running on the computer that receives the network communication and then does the keyboard emulation(actually I prefer using command line interface instead of shortcut keys whenever possible). I use a program called EventGhost to receive TCP communication from my Arduino and then emulate keyboard or any other action I want. It also supports UDP, MQTT, and web server communication. There is also AutoHotkey and Girder that do the same thing. I think they're all Windows programs but I'm sure there are other options for any OS. As for latency yes you're probably not going to like a game controller connected over the network so much but it really depends on the application.
I can send an event from my Arduino to Eventghost and back via TCP in around 8 milliseconds, I'm sure it would take less time than that for a one way send and a keyboard emulation. I'm guessing it would be even faster using UDP.
chuco61:
I am more of a believer in hard wired components.
Me too, that's why my whole home automation system is connected using Ethernet.
chuco61:
Unless there is a way to network the computers together with some kind of hub
Router with at least 4 ports
chuco61:
Plus i am on Mac OS, using 3 mac minis.
If you search a bit there are definitely mac compatible alternatives or you may be able to get one of those programs I listed running on the mac.
It's just another option to consider. One reason I prefer Ethernet to USB is that I can easily use long cables. Long USB cables never seem to work reliably for me, even the active ones.
The Arduino doesn't need to communicate with the router. The router just routes network communication. Your Arduino will have an IP address and your computers each have an IP address. So when you send a message from your Arduino to the IP address of one of the computers then the router just makes sure the message goes to the right place. If it is configured correctly this will just work, and you can just pretend you're sending the message straight to the computer. A good example for this is the Ethernet library's ChatServer example.
So to use Ethernet for your project you would need an Ethernet shield or module for your Arduino. These are available with a few different Ethernet controller chips on them. I would not recommend getting one with the ENC28J60 as these are less reliable. The Arduino Ethernet library only supports the W5100 but there are other good libraries that support the W5200 and W5500 chips. The computers already have an Ethernet port. So the Arduino and the computers are all connected to the router using Ethernet cables. Usually you would also have the router connected to your Internet modem but in this case that is not necessary because you are just creating a local network.