I have a project that involves a box between the keyboard and the computer. It will receive the signals from the keyboard, and then remap the keys to different keys. This will include multiple keys, multiple keyboards mapped differently, etc. It goes beyond the ability of the Windows keyboard mapping capability, so I'm thinking to do it in hardware.
On an Arduino Due, can I use the two USB ports like this? One as host to the keyboard, and one as a slave device to the computer, emulating a keyboard?
Will this setup impact the ability to reprogram the Arduino, as I'm using the port for the function of the device, rather than the programming interface?
Edit to add - I also want the Arduino and the keyboard to both be powered from the computer.
I'd like to turn an old USB keyboard into a simple MIDI controller, by connecting it into the USBHost, and making the programming port act like a USB HID device.
Pagus:
Teensy 3.6 and 4.1 have one USB device port and one USB host port. USB keyboard is supported on both ports.
That would be great, but I've looked up the Teensy boards, and there is only one USB connector, and specs only say one USB Host Port.
I went ahead last night and bought a Uno plus USB shield, so I'll prototype with that, but if I can jump over to the Teensy later, that would be superb, as I could probably fit the tiny board inside the keyboard. The flash memory would be handy too.
Edit to add - the USB ports on the Due can be Host or Device, but not one of each, AFAIK.
Edit again - Hmm, I still don't know if this is true or not.
Yes, Leonardo has a native USB device port. Real Unos have 16u2 which is harder to use but might work. I never used it.
Clone Unos have CH340 or cp210x USB to serial chips which cannot do native USB.
The following is a picture of a Teensy 4.1 with keyboard plugged into the USB host port. The USB connector on the micro USB connector on the left end of the board is the USB device port. The Teensy 3.6 works in a similar way. The USB host cable can be ordered from PJRC along with the Teensy boards.
Pagus:
Clone Unos have CH340 or cp210x USB to serial chips which cannot do native USB.
Yep, I bought a clone Uno. Might have to put the Clone Uno towards a different project, and go with a Leonardo, or Pro Micro. Teenys are a lot more expensive by the time they get to Australia, but I may consider it, just for the small form factor, and ease of use with everything on one board.