I want to control my mouse with a ps2 joystick and a Mega 2560. I can read the coordinates of the joystick, but the Mouse.h library is meant for Leonardo or Micro only, so I cannot use the coordinates to control the mouse. I wanted to use a normal c++ file in eclipse to read the serial port data, store it in an x variable and a y variable, and use the coordinates to move the mouse with SetCursorPos in the Windows.h library.
I wanted to use a normal c++ file in eclipse to read the serial port data, store it in an x variable and a y variable, and use the coordinates to move the mouse with SetCursorPos in the Windows.h library.
that could work indeed if you can post events to the system queue from your program
ideally you would need a USB HID capable arduino or shield so that your arduino appears like a mouse and there is no software to install on the computer
Can you please suggest some code or other solutions that do not involve purchasing products? I would prefer C/C++ code with as few dependencies as possible.