The arduino due has 2 micro-usb ports that you can connect to two separate computers. I need to send different keyboard signals to each computer. How would I do this?
-
possible duplicate of Can the 2nd MCU on the UNO R3 be used for keyboard emulation?– Ignacio Vazquez-AbramsJul 23, 2015 at 21:41
-
Guess what the other USB connector on the Due is connected to. That's right, a ATmega16U2.– Ignacio Vazquez-AbramsJul 23, 2015 at 21:42
-
@IgnacioVazquez-Abrams except that is not what he is asking. He's asking "How to send keyboard signals to two separate computers" of which he has a theory that because it has two USB ports, this should be possible. Even if this isn't the case, the other answer doesn't answer his question.– Jake CJul 23, 2015 at 21:47
-
@JakeC: It actually does. The answer is "reprogram the '16U2 to act as a keyboard". Communication between the SAM3X and the '16U2 is left as an exercise for the reader.– Ignacio Vazquez-AbramsJul 23, 2015 at 21:50
-
@IgnacioVazquez-Abrams But because it doesn't specifically address multiple computers, it doesn't fulfill the criteria of a duplicate question.– Jake CJul 23, 2015 at 21:55
2 Answers
While the Arduino Due has two separate USB ports, only one of them is a native port accessible to the processor. The second port is only usable for programming, and is connected to a different and much smaller chip that handles the programming task.
To connect to multiple computers from an Arduino Due, you have two options:
- You can reprogram the second MCU to allow it to connect to the computer as a keyboard. This method is tricky because it requires an external programmer for it to work.
- You can use a software USB implementation such as V-USB to use regular digital pins to connect to the computer. This is also tricky because it requires a little electronic know how a few extra components to make this work.
Both options require a little something else to make it work, so you will have to pick based on what you feel more comfortable doing.
For one of them, use Keyboard
as you normally would.
For the other, do whatever Can the 2nd MCU on the UNO R3 be used for keyboard emulation? tells you to do to reprogram the ATmega16U2 connected to the other USB connector.