Pages: [1]   Go Down
Author Topic: Looking for Coder for 5v key press.  (Read 580 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

basically I want to use a arduino and have it detect a 5v input and simulate a key press until the 5v signal goes away to a computer where its basically emulating a keyboard. I wanted to contract out the code part.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49270
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I wanted to contract out the code part.
All 10 lines of it? Doing what you want, with the right Arduino, is trivial.

What is the PC going to be doing with that key press?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It triggers wave file to be played, Will a UNO3 work or do i need the leonardo?
Logged

Southern California
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PaulS is right, it's super easy, as a matter of fact, the example for the Keyboard.press() method does nearly exactly what you're looking for:

http://arduino.cc/en/Reference/KeyboardPress

Regarding which Arduino (from the Keyboard library reference):
Quote
The keyboard functions enable a Leonardo, Micro, or Due to send keystrokes to an attached computer.

I've come across a couple projects that accomplish this with an UNO:
http://www.practicalarduino.com/projects/virtual-usb-keyboard

But it looks pretty hacky/volatile, this is because the Uno delegates the USB side of the board to a custom programmed Atmega16U2 (which, with some effort, can be overwritten), where as the above Arduinos use the built-in USB capability of the main processor to communicate natively to other USB devices.

Logged

Pages: [1]   Go Up
Jump to: