I wrote this for use on pushbuttons. It first looks for an active low state. If seen, it counts loops for a constant low state, any high reloads counter. Exit is by loop countout: either constant low Or high state. In effect, it soft delays out the bounce. The loop count sets debounce delay. Note, it doesn't bounce-proof return to inactive high state. My std rules: free to use, But put "uMax/Sarge" associated with it somewhere. TNX <<<)))