How to Print Custom Chars LiquidCrystal + HD44780?

Hello there. ;)

Im pretty much a noobie on Arduino world, learning by example i managed to setup my board to use the LM35 Temp sensor following Daniel Andrade's guide then i dumped that data to a 16x2 HD44780 LCD display using LiquidCrystal Library.

I want to print some kind of custom icons for max Temp and Min Temp (animated maybe) but i dont Know how to create them (or even access the ones on HD44789 data Sheet).

I found a link on forums to obtain DEC, HEX and Binary values for custom chars at quinapalus.com/hd44780udg.html , but

How can i implement them using LiquidCrystal library?

How can i print the characters on HD44780 Char Set Table?

When i was searching for a way to print the Degrees Symbol, i found the solution using lcd.print((char)223);

Where can i find the table where that (Char)223 is equivalent to "º" ?

Because now I need to print the backslash char on my LCD "\" but the code wont compile.

Well i hope theres not to many questions for one thread.

Thanks for your time guys :)

You can find information on the character set in the datasheet for the LCD controller chip. It's the one on page 17 of the datasheet here: http://www.sparkfun.com/datasheets/LCD/HD44780.pdf

To use the table, you need to combine the upper an lower bits as follows: Find the symbol you want (for example the degree symbol) the table shows values of the upper and lower 4 bits. Convert the upper 4 bits to hexadecimal : 1101 is the hex value D Convert the lower 4 bits to hexadecimal : 1111 is the hex value F Combine these as : 0xDF (the 0x prefex tells the compiler that the value is hex) Print it as a hex value or you can convert it to decimal ( 0xDF equals 223 decimal)

Wow mem, that makes things a lot more clear, thanks for the info :)

Any idea on how to make the custom chars?

P.D excuse my bad english. ;)

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235524565
see kiwix second reply :slight_smile:

worked great for me.

btw: here’s an online char calculator
http://www.quinapalus.com/hd44780udg.html

EDIT:
use lcd.print(0) insted of lcd.write(0)

there was some code posted in this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1233722439

Using binary from the table, you can use the following to print a degrees symbol: lcd.write(0b11011111);

lcd.write() tells the library to write a specific character from the predefined table.

I can't help with designing your own characters, sorry. I haven't tried that part yet.

and how can we use the characters from page 18 and not 17 of the datasheet?

The ROM code is determined at manufacture so you would need to find a panel that used one of the following chips: HD44780UA02FS HCD44780UA02 HD44780UA02TF

See page 2 of the datasheet.