Lcd.print() won't work

Hi, I am having the problem that I can't print out a string variable using the lcd.
I never had a problem with this and the solution seems to be so simple, but I can't find it. I hope somebody has an idea.
Error Message in German: "Keine Instanz von Überladene Funktion "LiquidCrystal_I2C::print" stimmt mit der Argumentliste überein. -- Argumenttypen sind: (std::__cxx11::string) -- Der Objekttyp ist: LiquidCrystal_I2C",

->translated via google translate into English: No instance of Overloaded Function \ "LiquidCrystal_I2C :: print " matches the argument list. - Argument types are: (std :: __ cxx11 :: string) - The object type is: LiquidCrystal_I2C

Here is my Code:

#include <LiquidCrystal_I2C.h>
#include string // isn't shown on this forum, so I wrote it without the two symbols

class Window
{
public:
string Line1;
string Line2;

void setLines(string line1, string line2) {
    Line1 = line1;
    Line2 = line2;
}

string getLines()
{
    return Line1 + Line2;    
}

void printOnLcd()
{
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(Line1); // HERE IS THE ERROR
  lcd.setCursor(0,1);
  lcd.print(Line2); //HERE IS THE ERROR
}

};

Try String (capital S).

This solved my issue! Many thanks. However, it also created another error: In the method getLines() the two Strings can't be added together anymore. Do you know how to do that? Thanks again for your very helpful answer!
SOLUTION: I wrote string again in front of the method, it should instead have been String

:joy:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.