First of all, Thanks. But this is not the solution I want, because I write to the LCD with the buttons, I cannot do such a process.
I can not do the 2. answer because I am writing to the LCD with the buttons.
You cannot just “write to the LCD with the buttons”. You clearly have a code which interprets what the buttons signify and determines what character you wish to write to the screen. Therefore you simply write that same character to a buffer as you do so, and when you need to, whether for each character (which is I suspect, unlikely) or at the end of the entry of a string of characters, you write that buffer which now holds the same information as the screen, to the serial port.
You are the one who wrote the code to “write to the LCD with the buttons” are you not? So you simply alter that code to write to the same character to the buffer as it does so.
Yes, this is a “standard” 16 by 2 LCD module with an I2C “backpack”. I believe Bill Perry’s “HD44780” library does have the ability to read data back from the LCD but the point is that it is simply unnecessary since you already knew what characters you were writing to the LCD. It will most likely be easier for you to alter your present code to do this that to alter your code just to use Bill’s library as it is.
Of course, if you seriously wish assistance as to how to do this, you would read the instructions for posting information - point number 7 - and post your code here.
BTW: most of these are called QUAPASS; I think this stands for Quality Passed, but I don’t know.
“QAPASS” is a Chinese manufacturing irony. It stands for “Quality Assurance Passed”. If it ever was genuine which it clearly is not, it would be on a sticker which was applied to the module after it had actually been tested. However this is simply a part of the silk screened text overlay applied during PCB manufacture and so is utterly meaningless.