Special chars with Hitachi LCDs and LiquidCrystal

I have a LCD and I have it working with LiquidCrystal library. However I want to be able to write the "degree" symbol as in "degrees celcious". You know, the little circle. The Hitachi datasheet shows this character in the table of extra characters...it says that the upper byte is 1011 and the lower byte is 0000. How can I write this with the LiquidCrystal library? Will lcd.write(10110000) work?

This may help.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1265696343/0

There are 8 custom character slots that you can define on your own.

It should look something like this.

#include <LiquidCrystal.h>

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

// Array to define a custum character. 
byte Degree[8] =
{
  B00000,
  B01110,
  B10001,
  B10001,
  B01110,
  B00000,
  B00000,
  B00000
};

void setup()
{
  // assignes a custom Character to one of the 8 custum charicter blocks (0-7)
  lcd.createChar(0,Degree);
  
  lcd.begin(16,2);
}

void loop()
{
  lcd.write(0);
}

Just change the array as you see fit. 1 lights up an LCD pixel and 0 keeps it off. The array is built to represent one of the 5x8 digets on the display.

BTW this is more of a software question rather then a hardware interfacing question.

http://www.keokitrask.com/EDL/LCDCharacterGenerator.htm

I use this for custom characters but maybe it’s a bit ott if you only want a few.

Mowcius

Will lcd.write(10110000)

"10110000" is a binary number and to use binary numbers in Arduino applications you need a B prefix.

So if you write "lcd.write(B10110000)" you should be ok. Alternatively you could convert to hexadecimal notation (0xb0) or decimal (176).

The thing is though when I do lcd.print(176) the string "176" gets printed. I tried doing lcd.print(b10110000) but it didn't compile.

The degree symbol is not really a custom character I think; it's in the datasheet table I just need to know how to send it to LiquidCrystal so it gets printed properly instead of whatever I send getting literally printed as a string.

The thing is though when I do lcd.print(176) the string "176" gets printed.

This is as expected (lcd.print converts to ascii decimal). You initially wrote lcd.write() and that makes a difference. If you insist on using lcd.print, the correct syntax in this case would be "lcd.print(176, BYTE)". When using "lcd.write()" BYTE is implied.

If you want to use binary notation, the "b" prefix must be uppercase.

Thank you, I didn't know there was a difference between lcd.print() and lcd.write(). I should RTFD better.