Arduino Mega 2560 + USB Host Shield

Hello,

I have an Arduino Mega 2560 which does not support Mouse clicks nad Key strokes

Requirement is to utilize atleast 46 Digtial I/O pins to a Hardware.
Also connect to a Computer and do some Mouse movement and clicks on a particular software/page.

Can I use a USB Host Shield V2.0 for this with the Mega 2560 and utilize the above pins ?

If yes, how many Digital I/O pins, PWM pins and Analogue Pins from the Original Arduino Mega 2560 can be utilized once the USB shield is connected on top of the 2560.?

Or is there any other way which i Can try.

Looking forward to hearing from you.

Thanks & Regards
Jayashankar Pradeep

Can I use a USB Host Shield V2.0 for this with the Mega 2560

You can use the USB Host shield with a Mega. But, that doesn't seem useful for what you described.

A USB Host shield lets you connect a USB Slave, like a keyboard or mouse, to the Arduino which is also a USB Slave.

A USB Host shield does not let you emulate another USB Slave.

Thank u Paul,

So is there a way to emulate a mouse move and click on a connected PC using Arduino Mega 2560 alone?

Intent is to select certain applications using the D I/Os and as then select something from a specific software using mouse clicks at specific location. This is to be automated.

You could have the Mega decide what to do, and send that data to a Leonardo or Micro, and have the Leonardo or Micro act as mouse or keyboard.

Hey i had a quick question and I am having trouble using the Arduino mega and the USB host shield. On the the USBcore.h file I modified the code to:

typedef MAX3421e<P53, P49> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.), Intel Edison, Intel Galileo 2 or Teensy 2.0 and 3.0
#endif

Then, uploaded the board_qc sketch to check if everything was operating fine, but nothing was working. From there, I started testing a few things and when I modify the code to

typedef MAX3421e<P10, P9> MAX3421E; // Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo, Due etc.), Intel Edison, Intel Galileo 2 or Teensy 2.0 and 3.0
#endif

And I upload the board_qc sketch and everything is working good. I don't know, find it strange that when you change the pins to <P10, P9> it works. So my question is if it only works when i change the pins to <P10, P9> and everything is working fine so what pins is the USB host shield actually using for communication with the Arduino mega? Is there any fix?

Thank you for time