[SOLVED] How to Print °C in 16X2 LCD ?

Status
Not open for further replies.

asking

Full Member level 5
Joined
Sep 21, 2010
Messages
279
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Visit site
Activity points
3,377
Hello,

I need to implement LM35 As Temperature sensor in my power supply. So i need to put °C in the Display after the value of temperature. Please can anyone tell me how to print ASCII Characters on the display ?

thanks..
 

Thanks for information, I tried but the generated code looks too complicated to be added to the program. Ok m trying..it..lets see..
 

The ° character is contained in the character sets of many industry standard character displays. You should check the datsaheet of your device.
 

Asking, for example: (position 1 to 4 is reserved for temp data depend of your resolution...)
Lcd_Chr(1, 5, %11011111)
Lcd_Chr(1, 6, "C")
(print degree mark on first row/possition 5, on next possition print C)
regards

- - - Updated - - -

Me again, I forgot to write this example work on mikrobasic IDE with LCD lib...,
regards
 

The degree symbol is not included in most LCD displays, you can generate it easily with the custom graphics, the following example is for the PIC in assembler language.

movlw 40H ;location 0 user defined character for LCD
call COMMAND ;Degree symbol
movlw 1CH
call LCDDATA
movlw 14H
call LCDDATA
movlw 1CH
call LCDDATA
movlw 00H
call LCDDATA
movlw 00H
call LCDDATA
movlw 00H
call LCDDATA
movlw 00H
call LCDDATA
movlw 00H
call LCDDATA


Where LCDDATA is a routine that takes the contents of the W register and writes the data to the LCD data and COMMAND is a routine that takes the contents of the W register and writes the data to the LCD command. To display the character simply output 00H to the LCCDATA. One problem with generating a user defined graphic is that after you have written all the character data to the LCD you then have to set the cursor to a known position.
 

Thanks for the suggestion of using 0DFH, I have always defined this character before.
 
Last edited:

Hi
you can make any graphic character with "LCD char designer" within FastAVR compiler (only 3MB download)
http://www.fastavr.com/
example for your needs °:
DefLcdChar 0, &h00, &h0E, &h0A, &h0E, &h00, &h00, &h00, &h00
 

As said, you don't need user (CGRAM) characters for ° with most standard LCD displays.
They still have the original HD44780 ROM code 00 "Japanese standard font".
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…