How to read HD44780 LCD programmatically

robtillaart:

I would think a read function where you give it an address and length would be useful. What else?

primary functions would be

char lcd.readChar(row, col) // reads 1 char
char * lcd.readStr(row, col, len) // reads len chars - should it wrap around end of line?

some ideas:

char lcd.readChar(); // reads form last known (internal) row/col e.g. gotoxy(r,c); x = lcd.readchar()

char lcd.readNext(); // reads a char and moves to next position?

For reading data from the lcd, I'd prefer that it work just like the write() interface.
A single read() function that returns a byte(s) starting
wherever the address pointer is and lets it increment so it it is consistent with the write() interface.
i.e. a dual function overload:
read()
read(*buffer, size);

Any other needed functionality to set the location can be done by the users sketch code
using the existing API functions like setCursor()
Also having a simple read() API interface doesn't affect any of the other existing code
in the library as well as keeps the new API interface to support it clean and simple.

Having to deal with things like line wrapping on the display gets messy particularly since the existing Arduino supplied
LiquidCrystal library doesn't have any support for wrapping.

--- bill