More than 8 Custom Characters on LiquidCrystal Display?

Hi, I'm making a program for a school activity. My teacher said to make 12 DIFFERENT custom characters, but after making 12 custom characters, some of them keep repeating. I read somewhere that there is a limit of 8 custom characters. So I asked my teacher about it and he said that it was possible and to check my program again. I can't find out why some of my characters keep repeating. Help me please :frowning:

I'm using tinkercad btw

here's my program, please help me fix it 

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//7th sequence custom characters
byte AmongUs[8] = {
  B01110,
  B10001,
  B10111,
  B10111,
  B10001,
  B10001,
  B10101,
  B11011
};
byte heart[8] = {
  B00000,
  B00000,
  B01010,
  B11111,
  B11111,
  B11111,
  B01110,
  B00100
};
byte smiley[8] = {
  B00000,
  B00000,
  B01010,
  B00000,
  B10001,
  B10001,
  B01110,
  B00000
};
byte man[8] = {
  B00000,
  B00100,
  B11111,
  B11111,
  B11111,
  B01110,
  B01010,
  B01010
};
byte creature[8] = {
  B00000,
  B11111,
  B11111,
  B10101,
  B10101,
  B11111,
  B01010,
  B11011
};
byte house[8] = {
  B00000,
  B00000,
  B00100,
  B01110,
  B11111,
  B01110,
  B01110,
  B01110
};

//8th sequence custom characters
byte tongue[8] = {
  B00000,
  B01010,
  B00000,
  B11111,
  B00101,
  B00101,
  B00010,
  B00000
};
byte bell[8] = {
  B00100,
  B01110,
  B01110,
  B01110,
  B01110,
  B11111,
  B00000,
  B00100
};
byte music[8] = {
  B00001,
  B00011,
  B00101,
  B01001,
  B01001,
  B01011,
  B11011,
  B11000
};
byte down[8] = {
  B01110,
  B01010,
  B01010,
  B01010,
  B11011,
  B10001,
  B01010,
  B00100
};
byte LED[8] = {
  B01110,
  B11111,
  B11111,
  B11111,
  B11111,
  B01010,
  B01001,
  B01001
};
byte turtle[8] = {
  B00000,
  B00000,
  B10101,
  B01110,
  B01110,
  B01110,
  B01110,
  B10001
};
void setup()
{
  //7-8th sequence
  lcd.begin(16, 2);
  lcd.createChar(0, AmongUs);
  lcd.createChar(1, heart);
  lcd.createChar(2, smiley);
  lcd.createChar(3, man);
  lcd.createChar(4, creature);
  lcd.createChar(5, house);
  lcd.createChar(6, tongue);
  lcd.createChar(7, bell);
  lcd.createChar(8, music);
  lcd.createChar(9, down);
  lcd.createChar(10, LED);
  lcd.createChar(11, turtle);
  
}

void loop() {
  //7th sequence
  //1st row
  lcd.setCursor(0,0);
  lcd.write(byte(0));
  
  lcd.setCursor(8,0);
  lcd.write(byte(1));
  
  lcd.setCursor(15,0);
  lcd.write(byte(2));
  //2nd row
  lcd.setCursor(0,1);
  lcd.write(byte(3));
  
  lcd.setCursor(8,1);
  lcd.write(byte(4));
  
  lcd.setCursor(15,1);
  lcd.write(byte(5));
  
  delay(400);
  lcd.clear();
 
  
  //8th sequence
  //1st row
  lcd.setCursor(0,0);
  lcd.write(byte(6));
  
  lcd.setCursor(8,0);
  lcd.write(byte(7));
  
  lcd.setCursor(15,0);
  lcd.write(byte(8));
  
  //2nd row
  lcd.setCursor(0,1);
  lcd.write(byte(9));
  
  lcd.setCursor(8,1);
  lcd.write(byte(10));
  
  lcd.setCursor(15,1);
  lcd.write(byte(11));
  
  delay(400);
  lcd.clear();
  
}

The standard liquid crystal displays have memory for only 8 custom characters at one time.

However, your program can redefine those characters at any time, so just pick a good time to redefine four of them, and presto, you have shown 12!

Please edit your post to add code tags ("</>" button on post editor).

1 Like

Thank you for the reply! I'm new to arduino, what do you mean by redefining four of them and how do I do it?

"Redefine" means to change the bit pattern in a statement like this:

byte bell[8] = {
B00100,
B01110,
B01110,
B01110,
B01110,
B11111,
B00000,
B00100
};

Then store the new bit pattern using this:

lcd.createChar(7, bell);

The bits change, but the name and location (0-7) don't.

You can have as many named objects as you like but there are only eight locations to save them in the LCD memory.

1 Like

So you're saying I can't make 12 different custom characters in one program?

No.

I'm saying that you can store and display only eight different custom characters at any one time in the LCD memory.

1 Like

Oh okay sorry LOL
Thanks so much :smiley:

The explanation for the limit of a simultaneous display of a maximum of eight custom characters is here in the data sheet for the chip found in those LCD displays: https://www.sparkfun.com/datasheets/LCD/HD44780.pdf
See “Character Generator RAM”

1 Like

Thank youu!

@kiannarb, your topic has been moved to a more suitable location on the forum. Introductory Tutorials is for tutorials that e.g. you write, not for questions. Feel free to write a tutorial once you have solved your problem :wink:

Please edit your post, select all code and click the </> button to apply so-called code tags and next save your post. It makes it easier to read, easier to copy and prevents the forum software from incorrect interpretation of the code.

If you're problem issolved, you can indicate that a solution was provided by clicking the solution checkbox under the most useful reply so others (with e.g. the same problem) know that it's solved.

Thank you guys for the replies! Here's the program I made based on your and other people's advice:

void loop()
{
 //7th sequence
  /*i put the lcd.creatChar here in loop, 
  drew the sequence, then cleared the screen to avoid 
  repetition due to the 8 custom character limit*/
  lcd.createChar(0, AmongUs);
  lcd.createChar(1, heart);
  lcd.createChar(2, smiley);
  lcd.createChar(3, man);
  lcd.createChar(4, creature);
  lcd.createChar(5, house);
  
  lcd.setCursor(0,0);
  lcd.write(byte(0));
  
  lcd.setCursor(8,0);
  lcd.write(byte(1));
  
  lcd.setCursor(15,0);
  lcd.write(byte(2));
  
  lcd.setCursor(0,1);
  lcd.write(byte(3));
  
  lcd.setCursor(8,1);
  lcd.write(byte(4));
  
  lcd.setCursor(15,1);
  lcd.write(byte(5));
  
  delay(400);
  lcd.clear();
  
  //8th sequence
  lcd.createChar(0, tongue);
  lcd.createChar(1, bell);
  lcd.createChar(2, music);
  lcd.createChar(3, down);
  lcd.createChar(4, LED);
  lcd.createChar(5, turtle);
  
  lcd.setCursor(0,0);
  lcd.write(byte(0));
  
  lcd.setCursor(8,0);
  lcd.write(byte(1));
  
  lcd.setCursor(15,0);
  lcd.write(byte(2));
  
  lcd.setCursor(0,1);
  lcd.write(byte(3));
  
  lcd.setCursor(8,1);
  lcd.write(byte(4));
  
  lcd.setCursor(15,1);
  lcd.write(byte(5));
  
  delay(400);
  lcd.clear();
  
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.