Pages: [1]   Go Down
Author Topic: Arduino acting as keyboard  (Read 4217 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I've just newly discovered the Arduino and have ordered a kit which is on its way now.

I need my arduino to send simple keyboard comands to my computer through either PS/2 or HiD via USB.

Which would be the simplest to make? Which would be cheapest?

Can I just chop of a keyboard cable, hook the wires the pins on the arduion and get some random open source keyboard "emulator" software and start sending keycommands to the pc?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12849
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I suggest writing a utility that...
You can find most or even all of what you need on the internet and no special hardware is needed.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As another solution besides Coding Badly's, http://www.arduino.cc/playground/ComponentLib/Ps2mouse has a link to a library at the very bottom of the page. Scroll down until you get to "Emulating a PS2 device". The library can be used to make an Arduino act as a PS2 mouse or a PS2 keyboard. That qualifies it as your "random open source keyboard 'emulator' software."

That library needs a PS/2 port on your PC, not a USB port. You would probably be able to get a PS/2-to-USB converter to work if you needed your chopped off PS/2 keyboard cable to plug into a USB connector on your PC.

As you say, you could just chop off a keyboard cable, hook the wires to the pins on the Arduino, get that keyboard emulator library and start sending keycommands to the PC. If you were thinking that way already, give it a try.


« Last Edit: November 12, 2009, 10:52:12 pm by TBAr » Logged

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Another idea, which doesn't really take any "hacking" would be AACKeys... basically, it listens for ASCII values on a Serial port of your choice, then turns those into key presses.

For example, to type out Arduino Rocks! would simply be:

Serial.println("ARDUINO ROCKS!");

And there is a difference when using print and println, using println will actually press enter after the text. Also, you can set keys to do full keystrokes, or open programs/text files/delete anything/open/copy... you name it, it can be done!
Here's the link for the Serial program, based of SerialKeys:
http://www.aacinstitute.org/Resources/ProductsandServices/AACKeys/AACKeys.html

And, if you want to add some more abilities (such as emulating a keyboard and mouse, from 1 MCU)  this program can control your mouse/keyboard as if it was you!
http://www.autohotkey.com/  (this works with regular keyboards as well, not just for the Serial keyboard)

The Serial keyboard is pretty fun though, controlling video games with your Arduino is always exciting!:)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies guys smiley

The ps2 library captainobvious linked was exactly what i needed smiley-kitty
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Another idea, which doesn't really take any "hacking" would be AACKeys... basically, it listens for ASCII values on a Serial port of your choice, then turns those into key presses.
I can vouch for AAC keys, I have used it many a time for projects and it is very easy to use.

Mowcius
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I need my arduino to send simple keyboard comands to my computer through ... HiD via USB.
It's more work than a software only solution but: http://code.rancidbacon.com/ProjectLogArduinoUSB

--Philip;
Logged

Pages: [1]   Go Up
Jump to: