How to avoid video flicker

I am using the R8875 library for my 800x480 lcd display. When I move an object around the screen, the process loop is:

  • draw the object
  • wait a few milliseconds
  • draw the object again in black (erase it)
  • update the x & y location

While this loop moves the object correctly, there is some video flicker.

In the old IBM PC days, one would wait for a vertical retrace before drawing to eliminate flicker.
Is there a way to eliminate it with this library?

Also: can someone point me to the documentation for this libraries commands?

Which library? The Adafruit one works, but not quickly. The Sumotoy one is much better.

One method to eliminate flicker is to use the two pages that the RA8875 provides. Display one page while drawing on the other one, then swap.

You can make it work much faster by just redrawing the pixels that change. Some change from background to foreground (where the object is) and some change from foreground to background (where it was.) most of the pixels in and around the object probably don't change.

For more advanced usage, you can store graphic elements on the non-displayed page and copy them to the visible page. The copy operation is very fast.

I was using a library provided by the LCD vendor I just switched to the Sumotoy library. It flickers a little worse, but I will try to implement the page switch or copy process you referred to.