Reading USB keyboard input

Hey everybody,

I've gotten a question regarding receiving data via a usb module.

I have got a usb to ttl module with which I would like to read inputs from a usb keyboard. I'm not sure how to go about this with the current state of the IDE.

If someone could point me in the right direction that would be very much appreciated.

Do you mean a USB keyboard is connected to the USB2TTL module that is connected to the Arduino (what model?) and you what to read/decode key presses? Or is the keyboard connected to a PC that is connected to an Arduino via the USB2TTL module.

If you want to connect a USB keyboard to the Arduino then you either need an Arduino with a USB host port or a USB host module like this with HID keyboard stack. A USB/TTL module will not read a HID keyboard.

thank you Riva! especially for the link :slight_smile:

Just as a matter of reinforcing the earlier "thank you", I will echo my own thanks for the suggestion and link.

Solutions like this live long lives.

HobbyTronics just received a new order for the relevant USB Host hardware.

The HobbyTronics module looks good and looks like it has some good software options although, for keyboard interfacing, it looks like there is a way to do this without such an additional module.

USB keyboards can be connected to a PS2 interface on a computer using a simple physical adapter. This article shows how to use this with the arduino PS2 library to access a USB keyboard - https://www.instructables.com/id/Connect-Arduino-UNO-to-USB-Keyboard/