CD7220 VFD POS Display code help

Hi.
I have a code for the display, but has the following troubles:
Every second (maybe the refresh rate problem) the display clips.
The two buttons do not properly work for setting the time and date. (it jumps randomly)
I would want the settings to be different, i’d like a menu button for hour/minutes/month/day, and another button ‘forward’.

I’m using an Arduino UNO and the wiring are these:

A4 → SDA (DS1307)
A5 → SCL (DS1307)
D2 → OUT (DHT22)
TX → TX MAX3232
RX → RX MAX 3232

D4/D5 → Settings buttons.

cd7220dragos.ino (8.82 KB)