I was wondering how to print the degree symbol on an LCD. I've stumbled across some posts staying you need to put lcd.print((char)233);, however that does not give me the degree symbol, that gives me a little -1. Does anyone know what the number needs to be? Until then I'll just try random ones.
I'm not sure but I think mine is showing Japanese characters, or similar. Not sure if that matters or not.
I made a custom char for my project with a little c then the degrees symbol in one 5x7 section of the LCD. pretty easy to do
I was wondering how to print the degree symbol on an LCD. I've stumbled across some posts staying you need to put lcd.print((char)233)...
It depends on the ROM in your LCD controller chip. For an HD44780 (and probably many others) the degree symbol is at address 1101 1111. This would be 0xDF or 223.
The address 233 corresponds to address 1110 1001 which does indeed result in a superscript -1 symbol. It looks like you were the victim of a typographical error.
Don
The suggestion to learn how to create your own characters is a good one especially if the standard 44780 character set doesn't have a character that satisfies you. Writing a program to randomly create every character would help you learn both programming and patience. Writing a program to systematically create every character won't develop patience but might be quicker. Maybe I 'd be better educated if I did it this way but I cheat and use Google.
XOIIO:
I'm not sure but I think mine is showing Japanese characters, or similar. Not sure if that matters or not.
It probably does, but I imagine that would simply be a matter of changing the library. Try this anyway.
//Arduino 1.0+ Only
//Arduino 1.0+ Only
//? alt+127 and so on
// alt+167 is deg º
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,56,5,6,7);
void setup(){
lcd.begin(16, 2);
lcd.clear();
// Print a message to the LCD.
lcd.print("?Ǫºº");
}
void loop(){
}
If you can't find the datasheet for the driver, program a pager that scrolls through the characters. I just made a post about this exact thing. My TFT has about 1000 characters, so almost everything is in there. My 16x2 only had a couple hundred...
The reply has already been given, which is character 0xdf.
This Wikipedia article has a link to the datasheet for the display that has a map of all the characters Hitachi HD44780 LCD controller - Wikipedia.
All of the Hitachi controller LCDs I have seen are the type with the ROM set to the Japanese character set. The characters cannot be changed unless you can change the ROM on the display, which is a factory function and not dependent on the Arduino libraries.
Also has been suggested that you can define your own characters, but this is limited to just 8 (ASCII 0-7) and there are a lot of examples of how to do that on the forum and just using Google.