LiquidCrystal_I2C.h error? can't compile

Hello ,
I'm trying to run a simple sketch "hello world"

//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();

}

void loop()
{
    // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(3,0);
  lcd.print("Welcome to");
  lcd.setCursor(1,1);
  lcd.print("Tekno Networks!");
  delay(2000); 
  lcd.clear();
   lcd.setCursor(0,0);
  lcd.print("Arduino LCM IIC");
   lcd.setCursor(1,1);
  lcd.print("www.TEKNT.com");
  delay(2000); 
  lcd.clear();

}

but when I try to run it I get an error in the compile

LCD_Startup:6: error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]

 LiquidCrystal_I2C lcd(0x27, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display

                                  ^

In file included from C:\Users\Computer\Documents\Arduino\LCD_Startup\LCD_Startup.ino:4:0:

C:\Users\Computer\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal_I2C.h:53:4: error:   initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)' [-fpermissive]

    LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);

    ^

C:\Users\Computer\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal_I2C.h: In function 'void setup()':

C:\Users\Computer\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal_I2C.h:154:9: error: 'int LiquidCrystal_I2C::init()' is private

    int  init();

         ^

LCD_Startup:10: error: within this context

   lcd.init();                      // initialize the lcd

            ^

In file included from C:\Users\Computer\Documents\Arduino\LCD_Startup\LCD_Startup.ino:4:0:

C:\Users\Computer\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal_I2C.h:154:9: error: 'int LiquidCrystal_I2C::init()' is private

    int  init();

         ^

LCD_Startup:11: error: within this context

   lcd.init();

            ^

exit status 1
invalid conversion from 'int' to 't_backlighPol' [-fpermissive]

it's IDE version 1.6.7

what is wrong?

Thanks ,

Hi,

Take a look at this tutorial it may help you:

https://arduino-info.wikispaces.com/LCD-Blue-I2C

thanks
Stuart

david1234:
what is wrong?

There are many libraries that contain a LiquidCrystal_I2C class and they work differently.
The code you are using is not for the library you have installed.

You might consider using my hd44780 library. It is available in the IDE library manager.
It will auto detect the i2c address, and the pin mappings used on the backpack.
The i/o class for that type of device is hd44780_I2Cexp.
I'd first run the included I2CexpDiag sketch to verify that the h/w and s/w are properly working.
You can read more about it here: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

--- bill

Thanks ,
it help !