1. F Malpartida
  2. New LiquidCrystal
Issue #32 resolved

does not compile for Teensy 3.0

Anonymous created an issue

Love the library and use it all the time, thanks.

I am running a teensy 3.0 and when i try to compile this simple test, it errors out. Probably a non-explicit variable cast?

/usr/share/arduino-1.0.3_b11/libraries/LiquidCrystal/LiquidCrystal_I2C.h:53:4: error:   initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)' [-fpermissive]

/usr/share/arduino-1.0.3_b11/libraries/LiquidCrystal/LiquidCrystal_I2C.h: In function 'void setup()':
/usr/share/arduino-1.0.3_b11/libraries/LiquidCrystal/LiquidCrystal_I2C.h:154:9: error: 'int LiquidCrystal_I2C::init()' is private
test_lcd.ino:8:14: error: within this context
test_lcd.ino:4:32: error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
In file included from test_lcd.ino:2:0:
/usr/share/arduino-1.0.3_b11/libraries/LiquidCrystal/LiquidCrystal_I2C.h:53:4: error:   initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)' [-fpermissive]
/usr/share/arduino-1.0.3_b11/libraries/LiquidCrystal/LiquidCrystal_I2C.h: In function 'void setup()':
/usr/share/arduino-1.0.3_b11/libraries/LiquidCrystal/LiquidCrystal_I2C.h:154:9: error: 'int LiquidCrystal_I2C::init()' is private
test_lcd.ino:8:14: error: within this context

the simple test is this one:

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

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

void setup()
{
    lcd.init(); 
    lcd.backlight();
    lcd.setCursor(0, 0);
    lcd.print("b2cqshop");
    lcd.setCursor(0, 1);
    lcd.print("Voltage: ");
    lcd.setCursor(13, 1);
    lcd.print("V");
}
void loop()
{
    int val;
    float temp;
     val=analogRead(0);
    temp=val/4.092;
    val=(int)temp;//
    lcd.setCursor(9, 1);
    lcd.print(0x30+val/100,BYTE); 
    lcd.print(0x30+(val%100)/10,BYTE); 
    lcd.print('.');
    lcd.print(0x30+val%10,BYTE);
    delay(100);
}

Comments (4)

  1. F Malpartida repo owner

    Thank you very much for using the library and for your feedback.

    The problem you have is that you are trying to use a private class method "init" and you can't. Change init for begin.

  2. F Malpartida repo owner

    I have also seen that the object creation is not correct. Change for lcd(0x27).

    I suggest that you use the example applications that come with the library as reference and go through the documentation.

  3. keithspg

    ok, I played around and can now get it to compile by removing the rows/colums from the initialization and by changing init to begin.

    Can you explain to a non-coder why it is this way? I grabbed the sample from the sainsmart web page trying to get one of their boards working with a display.

    Keith

  4. Log in to comment