#include <LiquidCrystal.h>
// Initialize 16x2 LCD display:
// pin 1 - Reset (RS)
// pin 2 - Enable (E)
// pin 3 - D4
// pin 4 - D5
// pin 5 - D6
// pin 6 - D7
LiquidCrystal lcd(4, 2, 5, 18, 19, 21);
// The LCD allows the definition of up to 8 custom characters
// numbered 0 - 7. Each character has the size of 5x8 pixels.
// The custom characters can be defined as a byte array which
// defines the pixels that should be drawn.
// Demo custom character
byte symbol[8] = {
B00100,
B01110,
B01110,
B01110,
B11111,
B00000,
B00100,
B00000
};
// Or as integer numbers corresponding to the binary representation
// byte symbol[8] = {4, 14, 14, 14, 31, 0, 4, 0};
void setup() {
Serial.begin(115200);
lcd.begin(16, 2);
lcd.setCursor(0, 0); // Start from top left
lcd.print("Applied"); // Print a message
lcd.setCursor(0, 1); // Go to second line
lcd.print("Informatics");
delay(5000); // Pause for 5 seconds
lcd.clear(); // Clear the display
// Define a custom character on the first available slot (0)
// with the data from the symbol byte array
lcd.createChar(0, symbol);
lcd.setCursor(0, 0); // Set the cursor position
lcd.write(byte(0)); // Write the custom character from slot 0
delay(5000); // Pause for 5 seconds
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}