Closed wmarkow closed 6 years ago
It is something related to the power supply. When the phonograph's motor starts it needs some power at the beginning phase. Probably the voltage drops for a while in the main segment and the LCD gets restarted or something similar. It looks like Arduino is not restarted so the LCD is not initiated again.
I did a test and I was calling LCD begin() method every 5 seconds. It helps to recover from the strange case.
I'm not going to call LCD begin() every X seconds. It would be good to find out if something "bad happen" with the display and then perform reinit on LCD.
I'm using the new-liquidcrystal library.
According to this HD44780 documentation, it is possible to read some data from the LCD. I'm using I2C port expander to interface the display. The new-liquidcrystal library doesn't offer a method to read something from the display but I have managed to do this. Please take a look at my forked new-liquidcrystal branch. I have introduced a new method to get character at specific LCD's location (row and column). When the specific character at specific location is blank (but it shouldn't be blank - because I expect some text to be written there) I know that something happen and the screen is blank. Then I perform the LCD begin().
It works fine - for now.
I have reported an improvement new-liquidcrystal issues 79.
I know that my solution is just a workaround. I will try to improve the power supply by adding some capacitors.
A strange issue. How to reproduce: