I am wanting to be able to light an on-air light bulb by pressing a keyboard stroke using a Seeed Studio Relay Shield V1.3 connected to my Arduino UNO. Seems simple enough but I can't figure out the code.
Is there anybody out there who can help me?
What have you tried so far? How did it work? What didn't work?
We're not going to just do it for you. There is another section of the forum where you can hire someone for pay to write it for you. But this is the section for getting help with your code. To get much help here, you need more than just a request. You need the specs and to show that you've put in at least some small modicum of effort.
winstonstudios:
Yes, Paul that is what I am looking for.
You're going to be looking for a very very very long time then. You'll need some program running on the PC that sends the keystrokes to the Arduino via serial or some other interface. The Arduino has no way of knowing what the computer is doing by itself.
For communication with the PC, this can be a good start: Serial Input Basic - updated
It gives ideas how to implement serial communication (at the Arduino side) and can be tested with the serial monitor. Once you have that going, you can write an application for the PC (if needed).
Try something (after understanding both codes) by merging the two codes and let us know if you get stuck (in which case you need to provide your code).
Thanks so much! I guess there is no way of activating a SEEED Relay Shield with a Arduino UNO with a keystroke on the PC. I found a way with the Putty Session software but unfortunately I can't run it in the background while using other programs.
A program that interacts with a user can not run in the background
That depends on what is meant by "in the background". I can certainly run PuTTy and Firefox at the same time. I can position the Firefox window so that it overlaps (partially or fully) the PuTTy window. That puts PuTTy in the background, with Firefox in the foreground. I can then switch which application is active (making it the foreground process), and all others background processes.
What I mean is I am needing to be able to control the relay to turn the light on and off without having to have a terminal program open. I have it so I can control the relay but not without having the Putty program open and just as soon as I move the cursor to run another program I lose control of the ability to access the relay through the Arduino. Hope that makes sense, just hard to communicate it in words.
i admit I am totally new to Arduino and computer code so I really don't know what is possible to do with it.
I guess I am just looking for someone to confirm that it is or isn't possible. I just need to be able to turn a lightbulb on and off with a computer keyboard and maybe Arduino is not the way to go. The problem I am having so far is the inability to do this without having to have the cursor positioned on the Putty terminal program.
The Arduino can do its part, the problem is the controlling computer.
Or maybe even the user (no offense intended). You can easily switch between applications using on windows and linux systems (not familiar with apple), hit a key and switch back.
Or consider a button or two next to the keyboard, connected directly to the Arduino to control the relay.
Not sure why you need a PC, maybe you need to explain your needs a little more.
Ok here is the application. I have a digital software mixer called "Voice Meeter Banana" installed on my computer which controls all mixing needs for our radio station. It comes with macro buttons that you can use to control not only the aspects of the mixer but also external software applications as well. I have programmed one of the macro buttons to turn on the microphone. What I am trying to do is also have that same macro button turn on the "on-air" low voltage light.
Thanks for your help, I appreciate it greatly!
I have programmed one of the macro buttons to turn on the microphone. What I am trying to do is also have that same macro button turn on the "on-air" low voltage light.
Please explain the hardware which turns on the microphone. What is the physical link between pressing the button on the computer, and the microphone turning on?
You may be able to tie into whatever is happening, use that as an input to the Arduino and have the arduino switch the light.
The only hardware is the computer itself, the Arduino UNO and a SEEED Relay Shield V1.3. The actual button that turns on the microphone is a macro button which is part of the VoiceMeeter software.
Seems to be possible according to the documentation. You can start an application using the macro button.
So write an application that sends the commands over serial to the Arduino. There might be two options.
An application that toggles each time it's called; it needs to remember if the light is on or off or sense it. This will cost you one macro button.
The application needs to be able to accept an argument indicating on or off and you need two macro buttons.
Warning: the Uno resets when you open a serial connection to it. There are workarounds cutting a track on the arduino board or you can use an FTDI cable or a RS232 adapter connected to the rx and tx pins
Can you please provide a specific link to the audio interface used? Are there any indicator lights when the mic is live? Is thee a headphones out which goes live with the mic?
I already have the code to turn on the relay which will light the light using a stroke on the pc keyboard working just fine, I just need something that is not reliant on having the serial monitor or Putty program open. It only works if I have the mouse cursor on the serial monitor pointing on the send/command line.