Go Down

Topic: Looking for Coder for 5v key press. (Read 614 times) previous topic - next topic

brizey

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.

PaulS

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?

brizey

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

drewmutt

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.


Go Up