Hi,
I got this code SO CLOSE to working but I have just one more hump to get over. I have it set up to play a start up sound (that is supposed to take about 3 seconds) and then, when a button is pushed, go on to play a different sound and light up some LEDs.
The button push and the part after it work perfectly.
The start up sound works well except I need it to STOP after about 3 seconds (when it reaches it's peak) until I push the button to trigger the rest of the festivities. It is working except it doesn't stop UNTIL I push the button (however long I wait). Could anyone help? I believe the void setup() is where the problem is.

//LED Pin Variables
const int LEDS=5;
int ledPins[LEDS]={2, 3, 4, 5, 6};//An array to hold the pin each LED is connected to
int ledPin=10;//+ battery test lead connected to digital pin 10
int SPEAKER_PIN=8;
int buttonPin=9;
int buttonState = 0; // variable for reading the pushbutton status
void setup(){
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
//Set each pin connected to an LED to output mode (pulling high (on) or low (off))
for(int i=0; i<LEDS; i++) pinMode(ledPins[i], OUTPUT);
for(int i=500; i<2000; i+=6){ // adjust startupsound here
tone(SPEAKER_PIN, i);
delay(10);
}
while (digitalRead(buttonPin) != HIGH); {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
}
}
//value should be between 0 and 255 inclusive
void present(int value){
analogWrite(ledPin, value);
for(int i=0; i<LEDS; ++i)
digitalWrite(ledPins[i], value>(256*i+128)/LEDS?HIGH:LOW);
//tone(SPEAKER_PIN, map(value, 0, 255, 0, 400));
tone(SPEAKER_PIN, map(value, 0, 290, 0, 990));
}