2

I am using arduino leonardo for moving mouse pointer with head tracking using MPU6050. It works fine in general. But as soon as I connect an external lcd screen to my laptop via hdmi cable, it stops transmitting. (that is the TX led goes off altogether and the mouse stops moving) I am not able to figure out what the issue is here Will using a teensy 3.0 instead of leonardo solve this problem?

1 Answer 1

1

The issue is that the mouse coordinates are being set by the display device that it's attached to.

The computer sends a descriptor about the display to the HID device ( the mouse ) the mouse then uses the information about the logical size of the screen to co-ordinate the movements.

For example, to move with Mouse.move(100,100,0); you are not actually moving by 100 pixels, but by 100/(127-((-127)).

The only option is can suggest is to STOP the mouse and Restart it again - this will be easier to restart calculations again.

Heres my Logic Function to convert Percentage to appropriate values for Mouse.move();
int percentToLogic(int percent) { return percent*254/100; }

1
  • I have no idea how this answers this nearly six your old question, but I can see you put some effort into it. Typical mice transmit relative coordinates and have no idea how large the screen is or even whether or not one is plugged in. Absolute position mice send information with respect to where they are within their own coordinate system, and likewise normally completely unaware of the monitor connectivity and its geometry.
    – timemage
    Commented Apr 25, 2021 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.