What I want to do is have the user press a button and get a "beep" to acknowledge the button was pressed, but if the button is held for a short period of time the program will assume something else is to be done and jump to that routine.

The initial button command, no problem. The "held" status of the button puzzled me a bit, but I have came up with this idea.

If gives the user a short time to leave his finger on the button then if it doesn't detect it the program assumes the button wasn't held and starts again.

I have to do this for four buttons so I don't think it is the most efficient way, but I think it would work, but any other ideas that don't require interrupts or assembly would be appreciated.

Thanks,

Bart


Main:

delay=0
button portb.1, 1, 254, 10, delay, 1, Held

goto main

Held:

sound 0, 175, 25
hold=0
while hold < 5
hold = hold + 1
pause 10
if portb.1 = 1 then button_held
wend
goto main

button_held:

sound 0, 175, 25
pause 10
sound 0, 175, 24

' do something else here

goto main

end