Good beginner project for custom USB Input devices

Hi,

I have two Arduino projects I would eventually like to explore, but I realize they are probably not ideal for someone starting out:
A. A USB 'adapter' that inverts both axes of the connected USB mouse.
B. A USB input device with six buttons, that maps sequences of key presses to actual keyboard input. ('1' '2' '3' -> 'A')

I believe both projects are suitable for Arduino, and it would be awesome if someone could recommend projects / guides / articles / reading material that would set me on the right path.

I can't seem to find any online projects that intercepts and modifies the signal of a USB mouse like in project A.

So far I found the following articles that seem promising for project B:

But I'm not sure they are suitable for beginners. I would assume project B is more complex than A so I'd rather wait with this one.

I'm not new to programming in general but inexperienced with Arduino.

Appreciate the help.

I like your ambition, but the only Arduino board that will let you use the USB as a host device is the Mega.

If you are new to programming on the Arduino, I recommend that you buy a "sensor kit" (there's zillions of them on eBay) and an Uno board. Use the sample sketches in the IDE and experiment with the sensors in the kit. Do this and you will be more comfortable when you start designing your real projects.

Is that correct? I thought the Due, or a host shield was needed?

The macro keyboard project is easier. as it does not require complicated (external) hardware that can read an USB mouse.

Reading buttons is a straight forward exercise, simulating a keyboard as well.

For both projects you will need a board with native USB (HID capability). So do not buy an Uno, Nano or Mega for the project.

To get your feet wet with project B, the only thing that you need is a couple of buttons, a breadboard, some wire or DuPont cables and an Arduino Leonardo, Arduino Micro, Arduino Due (not sure if it has built-in host capability) or a SparkFun Pro Micro.

For project B, learn how to read buttons. This is covered in any Arduino getting started guide. Then learn how to use Keyboard.hto send USB keystrokes. In the IDE, see File | Examples | USB. This project is easier unless you want to make custom PCBs and design a 3D printed case.

For Project A, this may help. arduino leonardo - USB Mouse Passthrough - Arduino Stack Exchange. Unless you understand the USB protocol, it is hard to understand the code. But reversing x and y may not be too hard.

Apparently not, see reply #5

The Keyboard library page has a list of compatible boards.

I suggest ignoring answer #1 on the stack exchange page because it has a net vote of -1 even though it has the green solution check mark. Look at answer #2 which has a net vote of 2. It does require USB host and device. Stack exchange seems to be less and less useful as time goes on.

I developed a "box" for testing usb input on PC's. All details here

As has already been said you need a board with the necessary hardware - a SAMD or 32u4. I used a Micro Pro.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.