The display is working fine (picture 1) and then 'disintegrates". Fortunately this disintegration is not literal (American movies: lots of sparks coming out of the poor display accompanied by cracking and smoking).
It looks as if contrast in the upper line goes all the way up and that in the lower line all the way down (pictures 2). In other woreds: the display displays your text, but the text cannot be read because the contrast screws up! This points towards a contrast issue -- hence the remarks on the A0.
I recommend two actions:
-
Show a wiring diagram and/or a picture as detailed as picture 1 and 2 of the back of your unit.
-
I would certainly recommend to connect the wiper of a 10 pot meter to pin #3 of the LCD display and run the sketch you provided us with.
-
I learned at school that if the problem keeps appearling after replacing the 'faulty' decvce (i.c. the LCD display) with a similar one, then it is most probably a wiring problem or a software problem.
Hearing from you when you have returned home !