Leonardo plus USB Host Shield

I'd like to build a pass thru device like this:

mouse -> Arduino -> Desktop PC

The Arduino software will read mouse movements and clicks and recreate those for the PC. The purpose of the device will be to allow for the modification or automation of some mouse activity.

Leonardo can act as a mouse when connected to the computer. But to read mouse movements from a mouse I'm considering a USB Host Shield. Arduino lists this product as "retired" but there are some available from other manufacturers.

Is this the best setup? Will the available drivers allow for reading from one USB port while writing to another? Is there a better hardware configuration to get this done? Would much rather do this with a single Arduino and no shield but there doesn't seem to be an Arduino board that is capable.


I think what you really needed is a something with MAX3421E
As long as the controller is the same there will be no huge difference, although the way the microcontroller (Arduino) talk to MAX3421E (i.e. SPI? I2C? UART?) may be different. This may or may not allow you to copy-paste code (or straight from library).
In fact because the controller is the same most commands will be the same and therefore allow you to copy paste. There might be differences in communication but you can always choose the one that fits closest to the Arduino one.
The Arduino breakout uses SPI with the said pinout in the product page. This will help you create a "clone" for the shield.
Or you can find a second-hand or leftover shield on Ebay or something

Seems like the Mega ADK have similar capabilities, although it seems like it have even less documentation.

Got this to work. Pretty cool.



Could you clarify; what did you get to work? Only my second ever Arduino project so very much newbie; looking to do what I think you described; USB mouse in -> Arduino intercepts and transposes mouse actions; relays on real time -> PC.

FWIW Teensyduino 4.1 did it all in one.