Oh of course. How I forget it ;-x
Maybe it was too late 4 me ...
Code:Btn VAR PORTB.0 ' Your Input switch LoopTime VAR WORD InputButton: PAUSE 20 ' Button delay or use DEFINE BUTTON_PAUSE before IF Btn = 1 THEN Check4Button GOTO InputButton Check4Button: FOR LoopTime = 0 TO 1000 ' 1 Second PAUSE 1 IF Btn = 0 THEN Stp ' If button was released before 1 Sec = short keypress NEXT LoopTime IF Btn = 1 THEN Park ' If button was hold longer than 1 Sec = long keypress GOTO InputButton Stp: ' Here is your code Park: ' Here is your other code END




Bookmarks