Pages: [1]   Go Down
Author Topic: Degrees symbol on lcd?  (Read 985 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure but I think mine is showing Japanese characters, or similar. Not sure if that matters or not.
Logged

South UK
Offline Offline
God Member
*****
Karma: 5
Posts: 581
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4248
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Code:
//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(){

}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1251
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller.

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.
« Last Edit: June 24, 2013, 07:25:19 am by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: [1]   Go Up
Jump to: