#include <LiquidCrystal.h>
// LCD pins <--> Arduino pins
const int RS = 11, EN = 12, D4 = 2, D5 = 3, D6 = 4, D7 = 5;
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
byte customChar0[8] = {
0b00000,
0b01010,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000,
0b00000
};
byte customChar1[8] = {
0b00100,
0b01110,
0b11111,
0b00100,
0b00100,
0b00100,
0b00100,
0b00100
};
byte customChar2[8] = {
0b00100,
0b00100,
0b00100,
0b00100,
0b00100,
0b11111,
0b01110,
0b00100
};
void setup()
{
lcd.begin(16, 2); // set up number of columns and rows
lcd.createChar(0, customChar0); // create a new custom character (index 0)
lcd.createChar(1, customChar1); // create a new custom character (index 1)
lcd.createChar(2, customChar2); // create a new custom character (index 2)
lcd.setCursor(2, 0); // move cursor to (2, 0)
lcd.write((byte)0); // print the custom char 0 at (2, 0)
lcd.setCursor(4, 0); // move cursor to (4, 0)
lcd.write((byte)1); // print the custom char 1 at (4, 0)
lcd.setCursor(6, 0); // move cursor to (6, 0)
lcd.write((byte)2); // print the custom char 2 at (6, 0)
lcd.setCursor(8, 0); // move cursor to (2, 0)
lcd.write((byte)0);
}
void loop()
{
}