The main problem is, that the picture loop is always executed. It is better to redraw the display only in those cases where the content of the screen has changed. My suggestion is to introduce a flag "is_update_required" and execute the picture loop depending on this flag: