#include<LiquidCrystal_I2C.h>
LiquidCrystal_I2C LCD (0x27,16, 2);
bool vymena=true;
String meno_1="Matej";
String meno_2="imurdiak";
unsigned long previousmillis=0;
byte customChar[] = {
  B01010,
  B00100,
  B01110,
  B01000,
  B01110,
  B00010,
  B01110,
  B00000
};

void setup() {
Serial.begin(115200);
LCD.init();
LCD.backlight();
LCD.createChar(0, customChar);
}


void loop() {
  if(millis()-previousmillis>=1000){
    previousmillis=millis();
    LCD.clear();
  if(vymena==true){
      LCD.setCursor((16-meno_1.length())/2,0);
      LCD.print(meno_1 );

      LCD.setCursor((16-meno_2.length())/2,1);
      LCD.write(0);
      LCD.print(meno_2 );
  }
  else{
    LCD.setCursor((16-meno_2.length())/2,0);
      LCD.write(0);
      LCD.print(meno_2 );

      LCD.setCursor((16-meno_1.length())/2,1);
      LCD.print(meno_1 );
  }
  vymena=!vymena;
  }

}