Program Upload Problems (and potential code errors?)

Hello!
I have written a code for the Arduino Lilypad to create a keyboard. The physical keys are created with velostat filled pocket sensor buttons. The seven keys each go to a different note, with each note designated to a different pin. There may or may not be an error with my code (though it does compile), but when I attempt to upload my program to my Arduino, the program returns with an error. (Failure to upload, see Arduino troubleshooting page, etc.)
I tried then to upload the Blink sketch from the Example files, and it returned the same error.
Is there anything I can do to salvage this possible hardware malfunction? Could there be something erroneous about my code as well?
Thanks, in advance! I appreciate the help!

[int speakerPin = A5 ;	// speaker connected to digital pin 9
int noteA = A3 ;
int noteB = A2 ;
int noteC = 11 ;
int noteD = 10 ;
int noteE = 9 ;
int noteF = 6 ;
int noteG = 5 ;
	 
void setup()	 
{	 
         pinMode(noteA, INPUT);
         pinMode(noteB, INPUT);
         pinMode(noteC, INPUT);
         pinMode(noteD, INPUT);
         pinMode(noteE, INPUT);
         pinMode(noteF, INPUT);
         pinMode(noteG, INPUT);	// sets the ledPin to be an output
         pinMode(speakerPin, OUTPUT);	// sets the speakerPin to be an output
}	 
 	 

 	 
void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds)     // the sound producing function
{	 
          int x;	 
          long delayAmount = (long)(1000000/frequencyInHertz);
          long loopTime = (long)((timeInMilliseconds*1000)/(delayAmount*2));
          for (x=0;x<loopTime;x++)	 
          {	 
              digitalWrite(speakerPin,HIGH);
              delayMicroseconds(delayAmount);
              digitalWrite(speakerPin,LOW);
              delayMicroseconds(delayAmount);
          }	 
}	 
 	 
void playA ()
{         digitalWrite(noteA, HIGH);
          beep(speakerPin,3520,500);	//A
          digitalWrite(noteA, LOW);
}
void playB ()
     {    digitalWrite(noteB, HIGH);
          beep(speakerPin,3951,500);	//B
          digitalWrite(noteB, LOW);
     }
void playC ()
     {    digitalWrite(noteC, HIGH);
          beep(speakerPin,4186,500);	//C
          digitalWrite(noteC, LOW);
     }
void playD ()
     {    digitalWrite(noteD, HIGH);    
          beep(speakerPin,2349,500);	//D
          digitalWrite(noteD, LOW);     
     }
void playE ()
     {    digitalWrite(noteE, HIGH);
          beep(speakerPin,2637,500);	//E
          digitalWrite(noteE, LOW);
     }
void playF ()
     {    digitalWrite(noteF, HIGH);
          beep(speakerPin,2793,500);	//F
          digitalWrite(noteF, LOW);
     }
void playG ()
     {    digitalWrite(noteG, HIGH);
          beep(speakerPin,3136,500);	//G
          digitalWrite(noteG, LOW);
     }
          	//turn on the LED
//          beep(speakerPin,2093,500);	//C: play the note C (C7 from the chart linked to above) for 500ms
          //turn off the LED
          
void loop()	// run over and over again
{	 
  if (digitalRead(noteA) == HIGH){
      playA();
  }
  else if (digitalRead(noteB) == HIGH){
      playB();
  } 
  else if (digitalRead(noteC) == HIGH){
      playC();
  }
  else if (digitalRead(noteD) == HIGH){
      playD();
  } 
  else if (digitalRead(noteE) == HIGH){
      playE();
  }
  else if (digitalRead(noteF) == HIGH){
      playF();
  } 
  else if (digitalRead(noteG) == HIGH){
      playG();
  }
  /code]

duplicate post deleted.

Post more specifics on the upload error and the hardware being used.

What is the exact text of the error message ?
What board and COM port have you got selected ?