Arduino as a Mouse

Hello everybody!
I’m wondering, if there is any library which will an arduinoboard be recognized as a mouse in Wondows, so that I can control the cursor by two potentiometers?
Or is there a different way to so so?
Thank you

No there isn’t.

The Arduino doesn’t have a true USB port, it has a chip that basically gives you a serial port and puts it into a USB wrapper. To the computer, the Ardunio is a virtual com port.

It should be possible to have software on the PC that will read the signals from the arduino over the virtual com port and translate that into mouse movements, but the Arduino will not appear as a mouse in windows.

I think you could use arduino as a serial mouse. Not sure if a potentiometer would help. Probably two switched would do.

Here you can find information about serial mouse protocol.

you could also have the arduino emulate a ps2 mouse. and either connect directly to the ps2 port on your computer or use a ps2/usb adaptor (these are typically $5-10 and do both keyboard and mouse, the small ones that come with your mouse are typcally only a plug converter). This pay you just plug it in and go. I would suggest using the adaptor so that you don’t run the risk of damaging the ps2 port. BTW the ps2 library in the playground only implements the host side of the protocol and not the device side.

It could be done with USB. I believe someone here in the forums managed to get AVR-USB running. I have not run AVR-USB on an Arduino, but I have used it on an ATTiny44. In fact, during testing I did set up the HID report for an absolute mouse, and controlled cursor position with two potentiometers.

I believe someone here in the forums managed to get AVR-USB running in the forums.

Yes, indeed: Arduino and AVR-USB information.

I haven’t tried a mouse but it should be possible.



Also, there is an existing chip called Easy Input, it is a keyboard emulator you can interface this directly with Arduino and let it handle all the protocols and interface with what ever computer regardless of Operating System.

p.s. Every time I type Arduino, its underlined with red (as if it was misspelled) :slight_smile: