Flickering OLED

How did it help you and would the problem have happened if you had only used 2 variables ?