Another way to do it
Code:ButtonPressCounter = 0 SWITCH-LOOP: IF PORTx.x = 0 THEN 'this is where your button is connected to, obviously IF ButtonPressCounter = 3 THEN ButtonPressCounter = 0 ButtonPressCounter = ButtonPressCounter + 1 IF ButtonPressCounter = 1 THEN GOSUB Program1: IF ButtonPressCounter = 2 THEN GOSUB Program2: IF ButtonPressCounter = 3 THEN GOSUB Program3: ENDIF GOTO SWITCH-LOOP: Program1: ...do something RETURN Program2: ...do something RETURN Program3: ...do something RETURN
Bookmarks