#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
byte customChar1[] = {
B00000,
B00000,
B00000,
B00100,
B00100,
B00100,
B00110,
B00110
};
byte customChar2[] = { // ส
B00000,
B00000,
B00001,
B01110,
B10001,
B01101,
B10011,
B11011
};
byte customChar3[] = { // ต
B00000,
B00000,
B00000,
B01010,
B11111,
B10001,
B10101,
B11001
};
byte customChar4[] = { // ม
B00000,
B00000,
B00000,
B11001,
B11001,
B01001,
B11111,
B11011
};
byte customChar6[] = { // อ
B00110,
B01111,
B00000,
B01111,
B00001,
B01101,
B01001,
B01111
};
byte customChar7[] = { // ล
B01111,
B01110,
B00000,
B01110,
B10001,
B01101,
B10011,
B11001
};
byte customChar8[] = { //ก
B00000,
B00000,
B00000,
B11110,
B01001,
B11001,
B10001,
B10001
};
byte customChar9[] = {
B00000,
B00000,
B00000,
B10010,
B10010,
B10010,
B11011,
B11011
};
void setup() {
lcd.init(); //initialize the lcd
lcd.backlight(); //open the backlight
lcd.createChar(0, customChar9);
lcd.setCursor(5, 0);
lcd.write((uint8_t)0);
lcd.createChar(1, customChar2);
lcd.setCursor(6, 0);
lcd.write((uint8_t)1);
lcd.createChar(2, customChar3);
lcd.setCursor(7, 0);
lcd.write((uint8_t)2);
lcd.createChar(3, customChar4);
lcd.setCursor(8, 0);
lcd.write((uint8_t)3);
lcd.createChar(4, customChar6);
lcd.setCursor(0, 1);
lcd.write((uint8_t)4);
lcd.createChar(5, customChar1);
lcd.setCursor(1, 1);
lcd.write((uint8_t)5);
lcd.createChar(6, customChar7);
lcd.setCursor(2, 1);
lcd.write((uint8_t)6);
lcd.createChar(7, customChar8);
lcd.setCursor(3, 1);
lcd.write((uint8_t)7);
lcd.setCursor(10,1);
lcd.print("ELEC");
}
void loop() {
}