View previous topic :: View next topic |
Author |
Message |
young
Joined: 24 Jun 2004 Posts: 285
|
How to display special character degree c on LCD |
Posted: Thu Jul 01, 2004 8:03 am |
|
|
I want to show temperature in degree c in my LCD, how to print out this special character degree C simble? |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Thu Jul 01, 2004 8:09 am |
|
|
Find the data sheet for your LCD display. Most manufacturers include a table of displayable symbols. Use the table to figure out the code to send.
If the table does not have the degree symbol, then you can make your own and store it in the CGRam of the display and call that instead. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jul 01, 2004 8:28 am |
|
|
I checked theback of my lcd it is CMC216NO6, I think it is from CMC company, however I could not find related datasheet anywhere, any suggestion that where I could get it? |
|
|
Guest Guest
|
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1938 Location: Norman, OK
|
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jul 01, 2004 8:49 am |
|
|
Thank you, I got it. |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jul 01, 2004 9:02 am |
|
|
Then after I know the code for degree c, then how should I program it
printf(lcd_putc, "%2d %sc",temperature, 0xdf);? oxdf is the code for degree c. |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Thu Jul 01, 2004 9:04 am |
|
|
All right, I got it, It is printf(lcd_putc,"%2d %c",temperature, 0xdf);
Thank you again |
|
|
SimpleAsPossible
Joined: 19 Jun 2004 Posts: 21
|
|
Posted: Thu Jul 08, 2004 7:43 pm |
|
|
How about the escape sequence:
Code: | printf(lcd_putc, "%2d " "\xdf" "C", temperature); |
or in octal notation which doesn't require the funny string stuff:
Code: | printf(lcd_putc, "%2d /337C",temperature, 0xdf); |
|
|
|
Guest
|
|
Posted: Fri Jul 09, 2004 7:43 am |
|
|
Quote: |
How about the escape sequence:
Code:
printf(lcd_putc, "%2d " "\xdf" "C", temperature);
|
is working fine
however the second command
Quote: |
or in octal notation which doesn't require the funny string stuff:
Code:
printf(lcd_putc, "%2d /337C",temperature, 0xdf);
|
have "printf type is invalide" error |
|
|
|