So I am trying to program a micro arduino to simulate a HID usb mouse and keyboard and the mouse aspect isn't working according to plan. I can move the mouse cursor up and down and from side to side, however, when I transition from moving in +x direction to -x direction, the cursor moves maybe a handful of pixels and then when i send the same command again, it works fine.. almost like it needs a warmup and stretch out or something haha.
Sample commands:
- mouse x 100> (the mouse moves 100 pixels to the right (+x direction));
- mouse y 100> (mouse moves 100 pixels downward (-y direction));
- mouse x -100> (mouse should move 100 pixels to the left but instead moves maybe 3 to 5 pixels to the left instead of 100);
- mouse x -100> (now the mouse moves the full 100 pixels to the left)
- mouse y -100> (mouse moves 100 pixels upward);
And the same thing happens if i decide to transition from +y direction to -y direction.
I have attached my code. Thanks for any/all help!
USB_Keyboard_Emulator.ino (4.57 KB)