After working on this for some time I have come up with a routine that does what I need it to do. I may use Timer1 to keep track of how long the button is held in place of PAUSE, but it works as is.
There are three button states 0, 1, 2:
0=no action
1=short press/release
2=Held
Switch_Routine:
ButtonState=0
IF Switch=1 Then ButtonCnt=0
IF Switch=0 Then
While Switch=0
Pause 250
ButtonCnt=ButtonCnt+1
IF ButtonCnt=ButtonHeld Then
ButtonState=2
Return
EndIF
Wend
IF ButtonCnt<ButtonHeld Then ButtonState=1
EndIF
Return
Bookmarks