#include <LiquidCrystal.h> // Import the required library
// Giving name to the lcd pins and adapt to an Arduino digital pin
const int rs = 12;
const int en = 11;
const int d4 = 4;
const int d5 = 5;
const int d6 = 6;
const int d7 = 7;
String text = "Hello World!";
// Telling to the LiquidCrystal library what pins will we use (but search about it)
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// Making pixel characters
uint8_t heart[8] = {
0b00000,
0b01010,
0b11111,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000,
};
uint8_t face[8] = {
0b11011,
0b00000,
0b01010,
0b00000,
0b00100,
0b10101,
0b10001,
0b01110,
};
void setup() {
lcd.createChar(1, heart); // Creating a character with ID 1 from the "heart" array
lcd.createChar(2, face);
lcd.begin(16, 2); // Telling the lcd what rows and columns to use
lcd.setCursor(1, 0); // Setting the cursor to the 2nd character slot and 1st row
lcd.write(uint8_t(2));
delay(111);
lcd.setCursor(3, 0);
for (int i = 0; i < text.length(); i++){
lcd.print(text.charAt(i)); // print the index i character of the text variable
delay(444);
}
lcd.setCursor(16, 1);
lcd.print("I \x01 Arduino!");
lcd.noBlink();
}
void loop() {
lcd.scrollDisplayLeft(); // Scrolling the whole display to the left by one character
delay(333);
}