0

I want to use mouse.h library with arduino but mouse.h library only for Leonardo not UNO . How to use mouse.h for UNO if not can we convert arduino UNO to Leonardo ?

0

The only way to use Mouse.h on an Arduino is to use it on a compatible Arduino. You cannot "convert" an Uno into a Leonardo, since you would have to not only replace the MCU on the board (with one that is SMD only), you would have to replace the PCB itself as well. I.e., throw away the Uno and replace it with a Leonardo.

The Mouse.h (and Keyboard.h) requires an MCU with a built-in USB interface, such as the ATMega32U4 that the Leonardo has. The ATMega328p does not have such an interface (note: the "U" in the name kind of gives it away...).

However, all is not lost. The Uno does have a chip on it with a "U" in the name (as long as it's a genuine Arduino board and not a cheap Chinese clone with a CH340G chip). That chip, used to interface the ATMega328p to the PC through USB, can be reprogrammed to look like different devices, however doing so can break your ability to then program the Arduino itself.

You can read more about hacking your Arduino to be a mouse here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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