Wiring
A single encoder with an integrated button has three legs on one side that connect the encoder and two legs on the other side that connect the button. The outer legs of the encoder side are connected to digital inputs on the board. The middle pin is connected to ground.
One leg on the button side is connected to a digital input on the board. The other leg is connected to ground. It doesn’t matter which button leg goes to ground and which goes to the board.