Request for Additional Information on using USB Host Shield with Gamepad

Folks,

Something similar has been discussed before:

https://forum.arduino.cc/index.php?topic=511952.0

But the answer was not complete enough to help me with my project.

I want to read information off of a Logitech Dual Action Gamepad.....and use it to
control a robotic arm.

The Github link:

Provides a great library and examples.

I'm able to implement reading the gamepad and getting the read out on the Serial Monitor.

Thankful for that.

But as the original poster asked....and now I'd love to know..... how do you transfer the information
printed to the Serial Monitor in the hidjoystickrptparser.cpp program into the arduino program.

It was suggested in the original post that you just put code in the .cpp program...but I have
to believe there is a better way to make it "available" to the normal Arduino environment.

Help would be greatly appreciated.

Doc

It would be easy to copy the contents of the .h and .cpp into the .ino file and remove duplicate lines. Then you can get rid of the .h and .cpp files. Next merge in code to run the motors/servos.

But the link between gamepad events and the motors still occurs inside the JoystickEvents::OnGamePadChanged function. I suppose merging the code files makes it easier to call motor functions from inside the OnGamePadChange function.

Thanks, I'll try that....

But I was hoping there was simply a way to return the data to the main Arduino program after events occurred....

I like keeping the functions separate....