Controlling Torches (Flashlights) through Keyboard input

Hi there.

I'm seeking a little guidance for a project I'm working on. My first, in fact. Please forgive any ignorance I might stumble into here, as I'm an absolute beginner to arduino, and actually... programming and electronics in general! I've been doing my best to teach myself through online resources, but think I little guidance here would be a huge help right now.

I'm working in theatre and have a week of research and development coming up for a project. One of the things we are looking into is using handheld, LED battery powered torches, and finding ways to effectively 'cue' them just as you would would normal theatrical lighting.

Ultimately I'd like to be able to press a button on a keyboard (e.g. Spacebar) in order to tell the arduino to trigger a specific piece of code. (Basically, IF spacebar is pressed then TURN ON the torch wired up to digitalpin 7 etc)

I've muddled through and taught myself enough to wire up the torches via a relay and got specific torches turning on and off through the arduino, blinking etc, so I'm ok with the basics there.

It's the keyboard input that's stumping me right now. I'm reading up on the 'keyPressed' and 'keyReleased' function - am I on the right track? And also am I right in thinking I'd need a Leonardo board? (I'm working with an Uno at the moment).

IF that is feasible then the next step would be to find out if it's possible to trigger different code depending on how many times the same button is pressed (e.g Spacebar is pressed the first time = lights turn on. Spacebar pressed a 2nd time = lights turn off. 3rd time, different lights turn on, etc)

I hope that makes sense! Thank you for your time to anyone who reads through my confused scrawling :o

So those torches are wired? Then it's no difference to a regular LED or so on the output pins. You may want more brightness, but that's all really straightforward that way.

I wouldn't use relays for this. You're probably better off using a MOSFET as electronic switch. More reliable, smaller, less noise, and they too can handle a lot of current.

The problem is the keyboard: you're looking at a computer keyboard? Those are not easy to interface with an Arduino. If you really only want one switch (or two: a second to reset your sequence) you better use regular push buttons that you can connect directly to the Arduino. Even so, assuming the sequence isn't too long, better use a separate button for each stage. Makes it easier to go back if you make a mistake, or to start halfway when practising, etc.

Yes that's correct the torches are wired and i'm talking about a computer keyboard. The torches are in a fixed position so effectively they're simply functioning as LEDs.

I understand the argument for having multiple physical buttons and it's on the cards! However the hope was to have the performer to be able to trigger everything wirelessly. I've software and hardware for sending computer inputs wirelessly with good reliability so the hope was we may be able to have the arduino trigger commands based off that keyboard input!

If you use a computer keyboard, you have to find a way to read that with the Arduino. You'd also end up with lots of useless buttons.

Arduinos can receive commands wirelessly, no problem there.

For fixed installations, unless distance is an issue, wired will be much more reliable.

Simple RF remote control fob to control 4 outputs. Momentary and latching. No CPU required. You will have to determine if the range and reliability is sufficient for your purposes.