LCD problem

The version of the code shown in the previous post just went into crazy mode, so no improvement with limiting the frequency of update.

Your results are very atypical, particularly with an adafruit display. These displays are very reliable when they are not around motors and relays. In noisy environments, it can be a struggle to keep them "garbage" free.

If you soldered the headers on, can you please provide a photo of the soldering. Also, a photo of your breadboard arrangement would be helpful.

As a first effort, try placing the largest capacitor you have across the Vcc and ground pins of the display.