Arduino acting a USB keyboard

I need to get my arduino to send keyboard signals through USB. I dont have the host shield but I can plug them directly in a USB port of a computer.

Say I need the arduino to type: HELLO! I would program it and when I press the go button, It will send the keystrokes to the USB port.

Please help me with this.

As it currently stands, you can't use a standard Arduino to do HID USB - the USB controller on the Arduino is just for virtual serial interfacing. However, you could make a shield, or set up a custom Arduino to act as a HID device - these links should help:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1258895121/0 http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241065918 http://hackaday.com/2009/01/17/cuiduino-arduino-with-true-usb-support/

Good luck...

:)

The easiest way is to have a tool running on the computer that converts stuff coming in from the serial port into keystrokes. This has been discussed before on the forum. I can’t remember the name of the application. If you can’t find it by searching, ask for more help. I suspect someone else will know the name.

Or, the Teensy can work as an HID…
http://www.pjrc.com/teensy/

GoBetwino - goes between the Arduino and the PC.

It would also depend on what he intends the final result for; if the app is supposed to be cross-platform, gobetwino won't be much help (unless your idea of cross platform is "if you aren't using windows, then bug off").

While building a USB HID interface for the Arduino isn't for the faint of heart, it opens up a greater number of platforms for your application, if that is your goal.

:)

Where did you read USB HID into the original question? It was kind of vague, but I wonder if you read something into the question that I didn’t.

I hate when people come here and ask questions, but then don't respond to requests for clarification.

A keyboard is an instance of an HID, isn't it?

Aside from software on the PC converting the serial input to keystrokes, the other "easy" solution is to spend $5 on a USB/PS2 adapter, and set the arduino up as a PS2 keyboard, which is well within its capabilities. http://www.dealextreme.com/details.dx/sku.1440

This is quite easy to do in VB, as there is a MS Serial library, and also a function to send keystrokes.

Paul:

The way the question was phrased, I assumed he wanted to simulate the keyboard on a PC via USB; the keyboard on the PC is a HID device, so...

Maybe I am reading too much into it, but that is what I was thinking...

:)

This is quite easy to do in VB, as there is a MS Serial library, and also a function to send keystrokes.

Which is just exactly what GoBetwino does, but unfortunately for Windows only. The one thing that GoBetwino does extra is to make sure that your keystrokes are send to the correct app. in Windows.

using the Sendkeys APi in Windows can be a mess because the keystrokes are send to the app. that has focus, and it just takes a stupid pop up window from messenger, og your anti virus program to take focus away from an app. and then your keystrokes goes somewhere else. GoBetwino makes sure that doesen't happen.

Even though the original poster seems to have wandered off…

using the Sendkeys APi in Windows can be a mess because the keystrokes are send to the app. that has focus

That’s what a keyboard does and is presumably what the original poster wants.

Yes, but if you do not implement some method that ensures that your app. keeps the focus then you can easily get in trouble.

I assume that the OP want to send keystrokes to one specific app. not a "random" app. that somehow got focus because of a pop up window, an unintended mouseclick etc. etc.

@cr0sh

There's that issue with acronyms that are not defined, again. I had to go google HID, to figure out that you meant Human Interface Device. If that is indeed what you meant, then we are thinking the same.

Initially, I was assigning a completely different meaning to HID...

Paul:

I agree to not say anything further about -anyone's- usage of the english language, if you agree to get off my case - deal? Let's just drop it and leave it, and move on.

In the future, I will do my best to define acronyms if I remember and feel that my audience may not know what the term means (for instance, I would hope that anyone working with electronics would know what an SCR is, and I wouldn't have to spell out "Silicon-Controlled Rectifier" - unless it was for an individual who seemed to be a newbie to electronics).

:)

@cr0sh:

I’m guessing from your reply to PaulS that you suspect he meant this…

I hate when people come here and ask questions, but then don't respond to requests for clarification.

…for you. I assumed he meant it for the original poster (who has most definately disappeared).

If you do not want to go for a hardware solution (which might be easier), you may want to have a look at this driver:

http://www.obdev.at/products/vusb/index-de.html

Cheers, Udo

No. In another thread, he suggested to the poster that acronyms should be spelled out, and then proceeded to use 5 acronyms without spelling out what they meant. I teased him about it. Then, we were having this misunderstanding that involved the use of the term HID. We had different understandings of what it meant.

@cr0sh I apologize for the 2nd jibe about acronyms. It wasn't meant in any kind of mean spirit. I was simply trying to emphasize the point you were making in the other thread that it IS important to spell out all but the most common acronyms, unless the context makes it clear what the term means.

Reminds me of a story my wife shared. While working for NASA, she attended a meeting about a shuttle payload. The discussion become VERY heated; almost reaching the point of a fight. One wise soul realized they had been arguing about completely different topics that happened to have overlapping acronyms!

No, actually he was meaning another thread (I think in a different forum here on the boards) where I made the dumb mistake of telling someone else to define their acronyms after the first time of usage, and then throughout the text I used plenty of acronyms without doing so myself; ie, in a way, being the "do as I say, not as I do" kinda guy.

:D

It was kinda embarassing; one of the those "Doh!" moments (and I said as much, too). I thought that was "the end of it" - I had learned my lesson (though my head is thick, so maybe not?).

So, in this thread I posted some more acronyms without defining them ("HID" - human interface device), I am not even sure of the sequence (ie, did I post before that thread, or after?); at any rate I find his response here a bit aggravating.

Or maybe I misunderstood his intent here and he was just ribbing me - if that was your point, Paul, ok ;D

I am not upset with him or anyone else here (and although I haven't seen him/her/it here in a bit, I am not even upset with April).

I do think I need to pick and choose who and what I comment on, give a little thought to each better; I am trying to do so, and trying to ignore some other's foibles and such. We're all beginners in some manner, I suppose, and we all ask "stupid" questions, and do "stupid" things; it's what makes us human, I suppose...

:P

BTW, Paul - what did you think "HID" meant? I am just curious as to the "collision" of terms...

Kinda like another thread where a poster said that RS was selling Arduino's, and I thought "Cool; Radio Shack is expanding their line again" - except it wasn't Radio Shack; apparently RS is a large electronics supplier in Europe, I believe; they have a branch here in the States called Allied Electronics, but they didn't have the Arduino listed - bummer...

:)