C# soundboard program controlled by 28 pushbuttons on Arduino Mega2560

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.

    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
    }

WTF? Have you never heard of strings?

    if (buttonState1 == LOW)
    {
      Serial.print("Penguin\n");   
      digitalWrite(ledPin, HIGH);    //  turn on the led
      delay(1000);                   // wait 1 second
      digitalWrite(ledPin, LOW);    // turn off the led
    }

You will absolutely, positively have to loose the delay() calls. State machines and the blink without delay example are in your future.

Two questions, though. Why does the Arduino have to blink the LEDs? Why send "Penguin" and a carriage return when sending the pin number that went HIGH as a byte means a LOT less traffic?

The original code I found here that I modified is from September 14, 2010. Doesn't even work anymore: "As of Arduino 1.0, the 'BYTE' keyword is no longer supported." is the error I get when I try to verify the original code.

int  buttonState = 0;
int inByte = 0;         // incoming serial byte
boolean isReadingData = 0; // kick off loop
const int ledPin =  13;      // the number of the LED pin
const int buttonPin = 2;  // the button pin
void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
  pinMode(buttonPin, INPUT);   // digital sensor is on digital pin 2
  pinMode(ledPin, OUTPUT);
}
void loop()
{
    // read the input state of the pushbutton
    buttonState = digitalRead(buttonPin); 
    // read the USB input
    inByte = Serial.read();  // read a character coming from the serial port
    if (inByte == 'A')
    {
      Serial.print('G', BYTE);    // write GO to the serial port
      Serial.print('O', BYTE);   
      Serial.print('\n', BYTE);   
      isReadingData = true;
    }
    if (inByte == 'B')
    {
      Serial.print('S', BYTE);    // write STOP to the serial port
      Serial.print('T', BYTE);   
      Serial.print('O', BYTE);    
      Serial.print('P', BYTE);   
      Serial.print('\n', BYTE);   
      isReadingData = false;
    }
    if (isReadingData  && buttonState == HIGH)
    {
      Serial.print('C', BYTE);    // write CAT to the serial port
      Serial.print('A', BYTE);   
      Serial.print('T', BYTE);    
      Serial.print('\n', BYTE);   
      digitalWrite(ledPin, HIGH);    //  turn on the led
      delay(1000);                   // wait 1 second
      digitalWrite(ledPin, LOW);    // turn off the led
    }    
}

The blinking I left in cause I thought it might be useful for testing, but it's not going to be in the final version.

PaulS:
WTF? Have you never heard of strings?

Heard of, yes.

As I said, I got that working by trial and error. I wasn't aware you could use a string instead of just a single character.
Thanks for pointing that out.

As of Arduino 1.0, the 'BYTE' keyword is no longer supported."

Just remove the comma and the word BYTE from those lines. They were not needed even with older Arduino code.

HINT - Try and take code from some on who knows what they are doing.

Grumpy_Mike:
Just remove the comma and the word BYTE from those lines.

I already did, I just posted the original code to show why I put every letter on a new line.

      Serial.print('G', BYTE);    // write GO to the serial port

Crappy code from 2010 hasn't gotten better with age. The BYTE keyword was not needed then. It's not needed now.

Printing a string one character at a time is a waste of effort.

Now that you know that you can print strings, stop doing it. The C# program is going to have to collect serial data into strings, and then map "Penguin" or "Pumpkin" to some meaningful number. Save the time needed to send the strings and the time needed to convert the string to a meaningful number. Just send the number.