Having looked at the PD8W code for the Bitx40 - (which uses a Si5351 , rotary encoder and a tft display) a few weeks ago and not being able to figure out ?the issue of erratic or no control when using push buttons. I put the code away and worked on some hardware.
A few days ago I thought I would try again to see if I could figure out the problem. ?Well, I got it to work.
The first issue was a hardware one. I had tried pull ups and downs and every wiring configuration I could find, but no go.
Then I tried one more config and Wow - the push buttons now work - smooth transitions, no jumping etc etc
I wired up the rotary encoder and used the rotary push button switch on the back of the rotary for the vfo frequency time step - works great.
Works well on the bitx40.
Now I am looking at how to make the MODE - LSB / USB etc work. ?I can control the mode functions on the display but it does not actually change to USB on the Bitx

I attached the button configuration
and the sketch I am using?
Hope there is some interest and can help figure out ?the mode issue.
Thanks
Joe
VE1BWV