Implementing software debouncer for encoder button