arduino mouse

Would it be possible to hack a ball mouse for a computer, by:

connecting digital outputs to the photodiode in the encoders, and by giving electrical pulses, make the mouse thing the encoder wheel is rotating, and therefore move the cursor?

Just a random idea I came up with.

A lot of optical encoders have open-collector outputs, so connecting another in parallel is probably doable by hanging a transistor off a digital pin. Of course, the one on your mouse might not, and you could end up frying it. But that's why scientists use mice for experiments: they're expendable ;D

If you're interested in an emulated mouse for practical purposes, rather than the challenge of digging into the hardware, you should be able to find code on the net by people who've used various micros to create PS/2 devices.

Ran

Okay, but is there anything mac-compatible that has been done? Something through Usb?

http://www.arduino.cc/playground/ComponentLib/Ps2mouse

at the bottom of the page theres a library for emulating a ps/2 mouse. perhaps it could be usefull

Ooooo, USB is tough: even if you have an Arduino with an FTDI chip on it, it looks like a serial port, not a mouse. If you're running an OS with serial mouse support, you may be able to program the Arduino to emulate one.

Failing that, your best bet probably is to take a USB mechanical mouse, pull its encoders, and emulate them.

Ran

Yeah, that's what I thought at first.
(emulating the encoders)