Reading from a 2 × 16 display?

Hello World!!

There is a pin called RW on a 2 × 16 LCD. It's function is to determine that is the LCD should read or write. Usually it is set to write mode to print characters on the screen. But, if I set it in read mode what will happen? What will it read?

LCD16x2 Pins.png

LCD16x2 Pins.png

LCD16x2 Pins.png

You do not "set" it to read mode, you would need the correct code to control the R/W pin in order to actually read from specific registers or the "busy" flag, since you need to write a command first to determine what is actually to be read.

Refer to the datasheet.

There's more to it than just setting it in read mode.

If you implement the pin properly you can do such things as reading the 'busy flag' and determining what character has previously been written to any of the memory addresses.

Don

Edit: Paul types faster than I do, I only use two fingers.

Oh ok Thanks for sharing the datasheet!

The hd44780 library supports reading from the LCD.
You can use status() to read the LCD status, which is the BUSY bit and the current DDRAM address.
You can use read() to read a data byte from the LCD.

In order to do reads, you must use an additional Arduino pin to control the R/W signal.
And the constructor must indicate which Arduino pin is used for the R/W signal.

For devices that use a i2c PCF8574 based backpack, it will "just work" since the backpack has the R/W pin hooked up to the PCF8574 chip.

--- bill

floresta:
Edit: Paul types faster than I do, I only use two fingers.

Fast, but not accurate. Frustrated without a spellign checker. :grinning:

bperrybap:
For devices that use a i2c PCF8574 based backpack, it will "just work" since the backpack has the R/W pin hooked up to the PCF8574 chip.

Oh ok...Thank you all!