/* Example sketch to create and display custom characters on character LCD with Arduino and
LiquidCrystal library. For more info see www.makerguides.com */
#include <LiquidCrystal.h>
// Creates an LCD object. Parameters: (RS, E, D4, D5, D6, D7)
LiquidCrystal lcd = LiquidCrystal(2, 3, 4, 5, 6, 7);
// Make custom characters:
byte Heart[] = {B00000,B01010,B11111,B11111,B01110,B00100,B00000,B00000};
byte Bell[] = {B00100,B01110,B01110,B01110,B11111,B00000,B00100,B00000};
byte Alien[] = {B11111,B10101,B11111,B11111,B01110,B01010,B11011,B00000};
byte Check[] = {B00000,B00001,B00011,B10110,B11100,B01000,B00000,B00000};
byte Speaker[] = {B00001,B00011,B01111,B01111,B01111,B00011,B00001,B00000};
byte Skull[] = {B00000,B01110,B10101,B11011,B01110,B01110,B00000,B00000};
// byte Crescent[] = {B00011,B01110,B11100,B11100,B11100,B11100,B01110,B00011};
byte Sound[] = {B00001,B00011,B00101,B01001,B01001,B01011,B11011,B11000};
byte Star[] = {B00000,B00000,B00100,B11111,B01110,B01010,B10001,B00000};
byte Lock[] = {B01110,B10001,B10001,B11111,B11011,B11011,B11111,B00000};
void setup() {
// Specify the LCD's number of columns and rows:
lcd.begin(16, 2);
// Create a new characters:
lcd.createChar(0, Heart);
lcd.createChar(1, Bell);
lcd.createChar(2, Alien);
lcd.createChar(3, Check);
lcd.createChar(4, Speaker);
lcd.createChar(5, Skull);
// lcd.createChar(5, Crescent);
lcd.createChar(6, Sound);
lcd.createChar(6, Star);
lcd.createChar(7, Lock);
// Clears the LCD screen:
lcd.clear();
// Print a message to the lcd:
lcd.print("Custom Character");
}
void loop() {
// Print all the custom characters:
for (int i = 0; i <= 7; i++) {
lcd.setCursor(2*i,1);
lcd.write(byte(i));
}
// lcd.setCursor(0, 1);
// lcd.write(byte(0));
// lcd.setCursor(2, 1);
// lcd.write(byte(1));
// lcd.setCursor(4, 1);
// lcd.write(byte(2));
// lcd.setCursor(6, 1);
// lcd.write(byte(3));
// lcd.setCursor(8, 1);
// lcd.write(byte(4));
// lcd.setCursor(10, 1);
// lcd.write(byte(5));
// lcd.setCursor(12, 1);
// lcd.write(byte(6));
// lcd.setCursor(14, 1);
// lcd.write(byte(7));
}