Yup, I still like to hardcode :/// In this case it was because I knew I will change the last language to cyrillic alphabet made out of custom characters.
Probably this last part could be smarter.
void kalba() {
//function telling users they should select the language
//four languages should switch between with the delay of 2 sec.
unsigned long currentLCDMillis = millis(); //check current time
unsigned long interval2 = 2000;
static unsigned long previousLCDMillis = 0; //set first old time to 0
const char *languages[] = {"Kalba?", "Language?", "Valoda?", ""};
static int langCycle = -1; //I want to increment it only AFTER it has been used the first time
const size_t MAX_LANG = sizeof(languages) / sizeof(languages[0]);
if (currentLCDMillis - previousLCDMillis > interval2) {
langCycle++;
lcd.setCursor (6, 0);
lcd.print(" "); //delete the old text
previousLCDMillis = currentLCDMillis;
if (langCycle == MAX_LANG - 1) {
yazik();
}
if (langCycle == MAX_LANG) {
langCycle = 0;
}
}
lcd.setCursor (6, 0);
lcd.print(languages[langCycle]);
}
//russian language made out of custom chars
void yazik() {
lcd.setCursor (6, 0);
lcd.write((byte)2);
lcd.print("3");
lcd.write((byte)3);
lcd.print("IK?");
}