Here's the thought; hook up an Arduino to USB port. Make it appear as an input or pointing device. Read text or mouse-pointing data off the Arduino.
It sounds as if it should be simple. But how do I do it?
Here's the thought; hook up an Arduino to USB port. Make it appear as an input or pointing device. Read text or mouse-pointing data off the Arduino.
It sounds as if it should be simple. But how do I do it?
The short answer is you don't
The Arduino USB port is really a serial port in disguise, implementen a real USB device with Arduino would be very complicated.
Some attempts have been made, but it's absolutely not easy.
If you want to know more Google USB + HID or maybee AVR USB
MikMo is right about the difficulty of emulating the USB HID protocol on the Arduino, but you may be able to achieve what you want without having to do that. A typical PC can understand the simpler PS2 mouse and keyboard protocol and these are much easier to emulate than USB HID.
This site describes the protocol:
http://www.computer-engineering.org/ps2protocol/
and the concepts for an Arduino clocking the data can be obtained from here
http://www.arduino.cc/playground/ComponentLib/Ps2mouse
Still work to do, that Arduino code talks the other side of the mouse protocol that you want, but it's a lot easier then building a USB stack.
Another approach to feed mouse and keyboard data is to send the data as bytes on the serial port and use a program running on the PC to read the serial port and use one of the operating system APIs to control the mouse cursor or feed keys into the keyboard buffer.
Its worth a search on google to see if there are pre-existing programs that do this but if you can write a program that can run on your PC, this approach is relatively easy to do
http://www.tinker.it/en/Products/Tastiera
it's based on an atmega168. Though this one seems to come from people around the arduino "foundation", it does not seem open source. so you'd have to buy it.
In case i was missing something, and there is code or a .hex for this out there, i would be interested to know.
best, kuk
Here's the thought; hook up an Arduino to USB port. Make it appear as an input or pointing device. Read text or mouse-pointing data off the Arduino.
I've been working on allowing the Arduino to operate as a USB HID device (e.g. keyboard or mouse) and my notes are available here: Learning About Arduino and AVR-USB
Short summary is that I've had some success with it working as a keyboard under Linux but not yet under OS X or Windows. I'm also yet to upload the modified code.
--Phil.