I need a way to take a HID input like a USB keyboard, decode the keys pressed and then output the characters to a USB serial port.
Is it possible to do this with a UNO or Teensy?
Also, I looked for an hour for any Arduino proto-boards that have usb host input and usb serial output but didnt find a single thing. Only shields and very expensive Due board.
Is there anything like a Teensy that I can connect a USB keyboard to and then connect that to my PC as a serial port?
Thanks.
This should work on Due or Zero. They have a native USB port for the USB keyboard and a serial programming port which connects to the computer.
Plug a USB OTG to USB host cable or adaptor into the native USB port. Plug a USB keyboard into the USB host port. Load this example program.
The same thing can be done cheaper using a Trinket M0 and USB to TTL serial cable. The Trinket M0 (not to be confused with the original Trinket) has a SAMD21 microprocessor so it can do many things a Zero can do except only a few pins are exposed.
gdsports:
The same thing can be done cheaper using a Trinket M0 and USB to TTL serial cable. The Trinket M0 (not to be confused with the original Trinket) has a SAMD21 microprocessor so it can do many things a Zero can do except only a few pins are exposed.
Hey very much obliged for those suggestions! It turns out I had a Feather M0 just laying
I also found some FTDI ttl-to usb converters in my drawer!
I have one question though, how would I connect the keyboard to the Feather or Trinket as both boards only have one usb micro-b female connector? I am wondering if that is only a programming port or if external usb devices can connect to it?
Thanks again!
The USBHIDKbd2MIDI project connects a Trinket M0 to a USB keyboard then outputs MIDI on a DIN connector. However, this can be changed to output ASCII characters instead and adapted for the Feather M0. And replace the MIDI DIN interface with the USB serial adapter. Check the Adafruit schematics and tutorial on powering the Feather M0 via its USB pin. It is safe on the Trinket M0. Note is NOT a good idea to power the Feather or Trinket M0 via micro USB port and USB pin at the same time. Be sure to have only 1 power source connected at a time.
I have never tried the Feather M0 in USB host mode. As I recall, the Arduino MKRZERO does work in USB host mode.