Button Acceleration

Hi guys,

New to the Forum but have been doing a lot of reading and searching.

I am stumped by this bit of code design:

I want the user to be able to set a large number ( say 0 to 1000 ).

the interface uses two buttons "Up" and "Down" and a third to confirm the selection.

In order to allow large numbers the buttons need to modify the step size as they are held down.

So initially they step =/1 1 Hold down for (say 10 increments) the step size jumps to 10 Likewise over a hundred step size jumps to 100

On release the step size resets to 0.

Has any one got a code fragment or is their a library with this functionality?

Many Thanks

Will

I would increment a variable every time the value was changed due to a button being down, resetting that count if the loop ever runs without the button being down. Then just check that count to see how much to change the value by.