Let me just start out by saying I have no experience in Arduino or C# code apart from derping around the past 2 days. (or any other programming language for that matter, unless you count basic HTML)
Some info on why I want to do this:
So, there is this charity called Zeldathon. It is a livestream marathon that lasts 120 hours straight, where mostly all of the Zelda games are played.
It takes place twice a year. Most recent one raised over $54,000 for St. Jude Children's Research Hospital.
As someone who has donated to the last 3 Zeldathons, I wanted to do something more.
On the stream, there is a soundboard which has various sounds and images. It currently has 20 buttons.
When a button on the program is pressed (with the mouse) the sound will play, and display an image on the program for the duration of the audio file. The streaming software (Xsplit) captures the screen region of the soundboard program for displaying the image on the livestream.
My plan:
I want to make a physical version of the soundboard, in terms of buttons. I have ordered 28 arcade-style pushbuttons and the Arduino Mega2560, to allow for an additional 8 sounds to be added if need be, without having to redo wiring.
It will connect to the streaming computer, and pressing a physical button will have the same result as pressing the corresponding button on the soundboard program on screen.
I am going to be making a fancy cabinet to house the buttons and the Arduino, wire everything up, and ship it overseas (Europe to USA) when it is done.
My problem:
I want to make sure I can get the software part working before I start building the cabinet and wiring it up.
I have thought about just building it, and have the Zeldathon crew work out the code later, but I'd rather not do that and just send them a working thing instead.
I have had succes with sending slightly modified example code to my Mega2560, but when it comes to the C# side of things, I've come to realize I'm in over my head on this one.
Even just getting Visual Studio to even start up on my laptop (Windows 7, 64bit) took a while, because derpy Microsoft.
I had to install the latest(?) version, "Microsoft Visual Studio Express 2013 for Windows Desktop", and even then half the stuff I've looked up online that I download won't work and throw up errors before Visual Studio even starts.
I have asked for, and been given a copy of, the soundboard program. Just the working program, not the code. The creator of the soundboard has said she will send me that aswell when she has the time to look for it.
Can someone help me out here?
So far I've figured out I need to have the Mega2560 send data over the serial com port, possibly just assigning a letter to each of the inputs for the pushbuttons, and I think I just might be able to figure that out myself.
Ok, just managed to get that working for 2 inputs before I actually decided to post this. Arduino code I ended up with through trail & error:
int buttonState1 = 0;
int buttonState2 = 0;
const int ledPin = 13; // the number of the LED pin
const int buttonPin1 = 22; // the first button pin
const int buttonPin2 = 42; // the second button pin
void setup()
{
// start serial port at 9600 bps:
Serial.begin(9600);
pinMode(buttonPin1, INPUT_PULLUP); // digital sensor is on digital pin 22
pinMode(buttonPin2, INPUT_PULLUP); // digital sensor is on digital pin 42
pinMode(ledPin, OUTPUT);
}
void loop()
{
// read the input state of the pushbutton
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
// read the USB input
if (buttonState1 == LOW)
{
Serial.print('P'); // write Penguin to the serial port
Serial.print('e');
Serial.print('n');
Serial.print('g');
Serial.print('u');
Serial.print('i');
Serial.print('n');
Serial.print('\n');
digitalWrite(ledPin, HIGH); // turn on the led
delay(1000); // wait 1 second
digitalWrite(ledPin, LOW); // turn off the led
}
if (buttonState2 == LOW)
{
Serial.print('P'); // write Pumpkin to the serial port
Serial.print('u');
Serial.print('m');
Serial.print('p');
Serial.print('k');
Serial.print('i');
Serial.print('n');
Serial.print('\n');
digitalWrite(ledPin, HIGH); // turn on the led
delay(1000); // wait 1 second
digitalWrite(ledPin, LOW); // turn off the led
}
}
I need to have the C# program either listen or be triggered by activity on the serial com port, check what letter is being sent (which button is being pushed) and have that trigger the same code that the on-screen soundboard buttons do. I don't think I'll be able to figure this out.