Try this
input portb.0 'input with pullup resistor
clear 'all variables = 0
start:
if portb.0 = 1 then start 'stay here until pushbutton pushed
waitforrelease:
if portb.0 =1 then pause 50 ‘debounce
if portb.0 = 0 then waitforrelease 'stay here until button released
let (your variable) = (your variable + 1) 'button released
goto start 'wait for another push
Bookmarks