State variables and millis help.

Wow strong responses,

that's Ok by me, they were useful and constructive.

I think at this point I should post my complete code, and give a full explanation of what I'd like to achieve. So here goes:-

The first thing I'd like to say is that I got this code from a search and then modified it to suit my needs. Without the hard work and determination of others, I wouldn't have got this far! Many thanks to Giuseppe Di Cillo (www.coagula.org) for providing the framework, and Alexander Brevig for providing the Library.

Now I need to fill in the gaps. And I thought it would be relatively easy. 8)

Code is too large to fit in post so I posted it here http://pastebin.com/R9Lg1tX5

Initially, I was only trying to get the Millis() delay to work, hence the alarmtest() function (lines 307-330.)

I don't know if it's obvious from the code, but whilst tinkering with it I realised that I ought to simply make a bleep() function, and then it could be multiplied to produce the alarm function(). That is the subject of this thread.

I also thought it would be cool to have an acceleration feature if the button is held down whilst incrementing/decrementing the timers.

I hope that this post has put some things in context.

It's late now, so I will experiment with your suggestions tomorrow!

Thank's for your contribution

Steve