Hi Tissy,
Here's a possibility. If you do the "De-bouncing" in hardware,
then you can use the COUNT command
Code:
Button2 VAR PORTC.0 ' use a pin with Schmitt Trigger input
Presses VAR BYTE
Down CON 0
Main:
if Button2 = Down THEN
WHILE Button2 = Down : WEND
' Mode = Something
COUNT Button2, 3000, Presses
BRANCHL Presses,[routine0, routine1, routine2, routine3]
GOTO routine0
endif
GOTO Main
'--------------
routine0: ' button was not pressed again
' or pressed more than 3 times
GOTO Main
'--------------
routine1: ' pressed once
GOTO Main
'--------------
routine2: ' pressed twice
GOTO Main
'--------------
routine3: ' pressed thrice
GOTO Main
Bookmarks