(SOLVED)LiquidCrystal_I2C::begin()' ERROR

HI

finally after 24 hour I found the solution to use LiquidCrystal_I2C HELLO WORLD with any error

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  

void setup()
{
  
  lcd.init();                      
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(2,0);
  lcd.print("Hello, world");
  lcd.setCursor(0,1);
  lcd.print("Ar.Mega2560 0x27");
   
}


void loop()
{
}

when I use lcd.begin(); there is always an error

this is the code and iand I found the library here

the error code is
no matching function for call to 'LiquidCrystal_I2C::begin()'

Arduino : 1.8.8 (Windows 7), Carte : "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\RAC\Desktop\khalil\menu_dotech\menu_dotech.ino: In function 'void setup()':

menu_dotech:18:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'

   lcd.begin();

             ^

In file included from C:\Users\RAC\Desktop\khalil\menu_dotech\menu_dotech.ino:8:0:

C:\Users\RAC\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.3/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)

   void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );

        ^

C:\Users\RAC\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.3/LiquidCrystal_I2C.h:58:8: note:   candidate expects 3 arguments, 0 provided

exit status 1
no matching function for call to 'LiquidCrystal_I2C::begin()'

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.

my bord is arduino mega 2560 - lcd 2*16-I2C PCF8574T

folder library C:
folder library AppData

how can I fix this problem

2 Likes

There are several different LiquidCrystalI2C libraries. They do not all use the same syntax. Be sure to use code that is compatible with the library that you are using.

I suggest that you try the hd44780 library for I2C LCDs. That library will auto detect the I2C address and, more importantly, the I2C expander to LCD pin mapping which can be a major stumbling block for new users. The library is available for download and installation through the library manager. In the Topic dropdown, choose Displays and enter "hd44780" in the filter box. Select and install the hd44780 library by Bill Perry. Use the hd44780_I2Cexp class.

Mr. GroundFungus you talking about this library

hd44780 by Bill Perry

LOGANTN:
Mr. GroundFungus you talking about this library

Yes, that one. :grinning: