audio help for 2 minutes

hello can somebody please help me?

I have a push button and a speaker. I want this:

1 push the button, 2 speaker will play for 2 minutes and 3 after that it wil stop.

I have no idea wat to do because at the moment it wil only play while I keep pushing the button! But thats not what I want!

We can't see your code. Use code tags.

Please show us the code you've got...

Are you playing a tone with the tone() function?

As always, take it one step at a time. That is, make a program that does nothing until the button is pushed, then start the tone and leave the tone on. Then when that's working, add the timer, etc. And if it's easier for you, start with the pin-13 LED instead of using a tone...

You'll probably need to use the timing technique from the [u]Blink Without Delay Example[/u]. The regular delay() function pauses the processor, so you can't do anything else during the delay time. (The tone() function might keep running during delay(), but I'm not sure.)

.......................................................................................... For example make a "do nothing loop".... I'd probably use a [u]while() loop[/u]... that just sits there looping until you press the button.

When you press the button and break-out of that loop, start the tone and follow that with another "do nothing loop" that loops until the time is up.

When the time is up and that loop exits, turn off the tone.

please post whatever code you have written and tried we can help you to go through it. That's easy step to move on just to play with time delay and tone function .