Simple way to use an Arduino Pro Micro as an input for a single keyboard button press on a PC?

Hey, All,

So, I have a Yamaha KU100 drum pedal that has a 1/4” TRS jack on the side.

This normally used with a midi controller for a drum kit - but I want to repurpose it.

I know that the TRS jack on the pedal outputs a simple open closed signal - so that’s super straight forward.

What I am looking to do is be able to hook that pedal to a windows PC so that pressing the pedal (and releasing) will act as an open/closed switch that the PC will see as a simple button press.

That way I can connect it to my PC and assign that button press to a game. It would be easiest to have it natively be recognized as a keyboard button press - but I can use antimicro or joy2key or the like if necessary to help.

What’s the most straightforward skit/code to do this?

I figure I would program the board and then connect each of the two leg wires from the foot pedal to the arduino - I’d then connect the arduino to the PC using the USB cable - and then the pedal would simply act as a giant input trigger than I can assign in my game.

What do you suggest? I have a Leonardo as well as a Nano, but I figure the Nano would be most appropriate as I could 3D print a small project box and attach it right to the side of the pedal.

That way the only wire (besides the short TRS cable going from the pedal to the arduino) would be the USB cable. Nice and clean.

Thanks a ton in advance!!

Nope. The Leonardo. It can act as a USB HID device. The Nano cannot (assuming you mean a classic Nano 3).

If you want something similar size to the Nano, get a Pro Micro (don't confuse with a Pro Mini).

Not a problem however how is the PC going to recognize the signal, there are normally no switch inputs for users. Who is going to do the hardware and software design for the PC?

Thanks. I forgot about that USB caviat. I actually DO have a pro micro right here as well.

If it makes it even simpler, the button press can natively simulate a keyboard button press.

Or I can use anitimicro or joy2key as well if necessary.

Yes, that's what I assumed you meant. What else did you think I might have been thinking of?

Not sure that those are.

EDIT: they seem to make game keypads act like a regular USB keyboard. You won't need those, I think.

I was just clarifying - at first I was implying that I needed it to simulate an arcade button press - but something as simple as keyboard input is fine.

Those two things I mentioned are just apps that could take one type of button press and have the computer convert it to a keyboard key press - but most likely not needed here.

Sorry for the confusion.

Do you have a sketch that you recommend?

There's a sketch in the examples menu in the IDE for simulating a keyboard. I would start there.

Depending what keyboard button press you want to simulate, you might want to look at the "multimedia keyboard" library which can simulate a wider range of buttons than the regular keyboard library, like play/pause/volume up/down etc.

Literally any letter key would suffice. Thanks so much for the help. I’ll just have to read up on where to connect the two lead wires to.

I’ll report back when I’m done!

Mission accomplished. Thanks again!!

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.