7 years ago.

LCD 16X2 BLUE

Hi guys, I'm trying to implement LCD 2x16 BLUE on mbed, and when I run this code below, it gives me an error :

  1. include "mbed.h"
  2. include "TextLCD.h"

TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); rs, rw, e, d0, d1, d2, d3

int main() { lcd.cls(); lcd.locate(2, 0); lcd.printf("Test Row1"); lcd.locate(3, 1); lcd.printf("Test Row2");

}

and ERROR is :

Error: No instance of constructor "TextLCD::TextLCD" matches the argument list in "main.cpp", Line: 4, Col: 14

1 Answer

7 years ago.

Please use the <<code>> and <</code>> tags to post readable code.

Which TextLCD library are you using? Both Simon Ford's original lib and my extended TextLCD lib don't use the RW pin (it should be tied to GND at the LCD side). That means the declaration doesn't recognize a constructor with 7 PinName arguments.

Try this instead:

TextLCD lcd(p24, p25, p27, p28, p29, p30); // RS, E, D4-D7

Accepted Answer