LiquidCrystal syntax help

Hi all,

I have a quick question dealing with the liquid crystal library. I am trying to use it to control an lcd set up as a 4-bit display. I currently have the R/W line tied to ground so that it is write only. Is there a way to use this library with that setup?

My problem comes from the command to set what pins I am using, I am not sure what to put in for the r/w pin.

The syntax- LiquidCrystal(rs, rw, enable, d4, d5, d6, d7) My code- LiquidCrystal lcd(12, gnd, 2, 7, 8, 9, 10)


  • Mark

The current version of the Library does not do much with the RW pin. It enables it as OUTPUT when the class is created and it sets it low whenever the LCD is written to.

You could set RW to any unused pin number but if you have none free then you may want to comment out few places in the LiquidCrystal.cpp that do something with the pin:

_data_pins[0] = d0;
_data_pins[1] = d1;
_data_pins[2] = d2;
_data_pins[3] = d3;

pinMode(_rs_pin, OUTPUT);
// pinMode(_rw_pin, OUTPUT);


void LiquidCrystal::send(uint8_t value, uint8_t mode) {
digitalWrite(_rs_pin, mode);
// digitalWrite(_rw_pin, LOW);

Don’t forget to delete the LiquidCrystal.o file. You may also want to put a comment in the file to remind yourself that it changed.

Thanks alot for the help! I am going to go do the changes now and hopefully it works. Thanks again! :) - Mark