/* by R. Jordan Kreindler August 8, 2020 happyemoji */ #include #include LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display byte happyemoji[] = { // Setup custom character in matrix B00000, B11011, B11011, B00100, B00100, B10001, B10001, B01110 }; int delay1 = 150; // Set delay, so custom character can be seen printing void setup() { lcd.init(); // Initilize the LCD lcd.backlight(); // Turn the LCD backlight On lcd.createChar(0, happyemoji); // Create custom character and assign to zero (0). // Can use values zero (0) through seven (7). That is, eight custom characters. } void loop() { lcd.setCursor(0, 0); // Set cursor at 1st line (line zero (0)) at position zero (0) lcd.print("Custom Character"); // Display "Custom Character" on 1st line of LCD for (int i = 0; i <= 15; i++) { // Set loop to display custom character in all positions on 2nd line lcd.setCursor(i, 1); // Set cursor on 2nd line (line one (1)) at position i lcd.write(0); // Display the custom character on 2nd line of LCD delay(delay1); // Add delay so custom characters can be seen displayed } lcd.clear(); // Clear the LCD so we can start again }