CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How do I display a '\' character on an lcd ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
webgiorgio



Joined: 02 Oct 2009
Posts: 123
Location: Denmark

View user's profile Send private message

How do I display a '\' character on an lcd ?
PostPosted: Sun Jun 11, 2017 9:18 am     Reply with quote

I use this i2c lcd driver:
http://www.ccsinfo.com/forum/viewtopic.php?t=54063

How do I print the backslash character? "\"
I tried "escaping" the "escape", printf(LCD_PUTC, "\\"); , and printf(LCD_PUTC, "\2 %c", 92); but I've got a Yen symbol.

So, this open to a more general question: is it possible to define custom characters?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 14, 2017 2:56 am     Reply with quote

webgiorgio wrote:

How do I print the backslash character? "\"
I tried "escaping" the "escape", printf(LCD_PUTC, "\\"); ,
and printf(LCD_PUTC, "\2 %c", 92); but I've got a Yen symbol.

It's caused by the character set in your lcd. Look on page 17 of the
HD77480U data sheet. Look at the font table for ROM code A00:
https://www.sparkfun.com/datasheets/LCD/HD44780.pdf

The ASCII code for a '\' symbol is 0x5C. The upper nybble is used to
select the column. So look on the top edge of the table, and find the
column for 0101 (5).
The lower nybble is used to select the row. So look at the left edge, and
find the row for 1100 (C). You will see the Yen symbol. I don't see a
backslash '\' in that font table. That font table is all you get.

webgiorgio wrote:

So, this open to a more general question: is it possible to define custom characters?

This post has sample code to make custom characters on an LCD:
http://www.ccsinfo.com/forum/viewtopic.php?t=40565
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group