#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Make custom characters:
byte Heart[] = {
B00000,
B01010,
B11111,
B11111,
B01110,
B00100,
B00000,
B00000
};
byte Bell[] = {
B00100,
B01110,
B01110,
B01110,
B11111,
B00000,
B00100,
B00000
};
byte Tee[] = {
B11111,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100
};
void setup() {
// Specify the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.backlight();
// Create new characters:
lcd.createChar(0, Heart);
lcd.createChar(1, Bell);
lcd.createChar(2,Tee);
// Clears the LCD screen:
lcd.clear();
// Print a message to the lcd:
lcd.print("Custom Character");
}
void loop() {lcd.init();
lcd.clear();//Clean the screen
lcd.setCursor(16, 1);
lcd.write(byte(2));
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.setCursor(16, 1);
lcd.write(byte(1));
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.scrollDisplayLeft();
delay(5000);
lcd.scrollDisplayRight();
delay(5000);
lcd.backlight();
// Print all the custom characters:
lcd.setCursor(16, 0);
lcd.write(byte(0));
delay(200);
lcd.scrollDisplayLeft();
delay(100);
lcd.scrollDisplayLeft();
delay(100);
lcd.scrollDisplayLeft();
delay(100);
lcd.scrollDisplayLeft();
delay(100);
lcd.scrollDisplayLeft();
delay(100);
lcd.scrollDisplayLeft();
delay(100);
lcd.scrollDisplayRight();
delay(1000);
lcd.setCursor(2, 0);//c/r
lcd.write(byte(1));
lcd.scrollDisplayLeft();
delay(1000);
lcd.scrollDisplayRight();
delay(1000);
lcd.setCursor(0, 0);
lcd.write(byte(0));
lcd.setCursor(2, 0);//c/r
lcd.write(byte(1));
lcd.scrollDisplayLeft();
delay(1000);
lcd.scrollDisplayRight();
delay(2000);
lcd.setCursor(16, 2);
lcd.write(byte(1));
lcd.scrollDisplayLeft();
delay(1000);
//lcd.setCursor(0, 0);
// lcd.write(byte(0));
/* lcd.setCursor(4, 0);
lcd.write(byte(0));
lcd.setCursor(6, 0);
lcd.write(byte(1));
lcd.scrollDisplayLeft();
lcd.setCursor(0, 1);
lcd.write(byte(0));
lcd.setCursor(2, 1);
lcd.write(byte(1));
lcd.scrollDisplayLeft();
//lcd.setCursor(0, 0);
//lcd.write(byte(0));*/
}