|
|
View previous topic :: View next topic |
Author |
Message |
webgiorgio
Joined: 02 Oct 2009 Posts: 123 Location: Denmark
|
How do I display a '\' character on an lcd ? |
Posted: Sun Jun 11, 2017 9:18 am |
|
|
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
|
|
Posted: Wed Jun 14, 2017 2:56 am |
|
|
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 |
|
|
|
|
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
|