Go Down

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


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.


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?
The art of getting good answers lies in asking good questions.


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


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:


Regarding which Arduino (from the Keyboard library reference):
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:

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