Trouble with using encoder and pid library together

Button2.h will allow you to get rid of a lot of debounce code you have manually inserted in your sketch, now it will be simply ifPressed