Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an Arduino plugged in my computer through the uart/tty port. I would like to use it as a mouse but I have no idea where to start with kernel/device drivers/etc.

Here is a little summary of what I did so far :

  • managed to push info from Arduino to the computer: I push a button, Arduino transmits to computer, and a bash script can tell that a button was pushed
  • started to read some stuff about device drivers and the Linux device drivers big book
  • wrote a small driver to play with gpio pins (mostly copied/paste from internet)

Now I would like my Arduino to act like a mouse, but not using the "mouse shields" or buy an Arduino that does it (mine is older, 2009). I am thinking of trying to use udev to redirect the USB from FTDI driver to something that I would write, and then fake that it is a mouse, but I am not really sure where to start and if it is viable.

This would involve to reverse engineer the FTDI protocol and read the characters sent, and then make the mouse move programmatically. But I didn't even find a library that works on my Linux on VMware to move the mouse. I found xdotool which is binary that can make my mouse move but that's it. I am not even sure either that from USB I can parse the FTDI protocol that converts Arduino chars to USB, and if this is the right direction anyway or if there is a way to call the FTDI driver to do that for me.

I welcome other solutions of course, but I would really like some guidance on that, I have been trying for months and I always end up buried in so many tutorials on the internet about everything.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.