hi all, I have been looking for a couple of characters to display. I cant work out how to do it. I can print a degrees symbol by printing char(223) but I found this line in a tutorial. etc but how do I use this table?
It's a binary table. It counts down the columns.
So ! is in column One 0010 (first column is zero) and on row 1 0001 so it's number is 00100001 which is dec 33
The is in column 12 1111 and on row 2 0010 11110010 dec 242
Some display have different character sets. So you want to to cycle through all the characters 0-255 printing the character and it's character code, to find the one you want.
I can print a degrees symbol by printing char(223) but I found this line in a tutorial. etc but how do I use this table?
Let's work backwards from your degrees symbol to the chart:
223 decimal ==> 11011111 binary
separate the two nibbles of 11011111 to get 1101 and 1111
use the high order nibble (1101) to find the column, it's the third from the right
use the low order nibble (1111) to find the row, it's the bottom row
look at the character in the box where they intersect, it's the degrees symbol.
Now lets go the other way and find the code for a character. I don't know the names of any of the Japanese characters so I'll use the 'right arrow'.
the right arrow is one row up from the bottom, near the center
the high order nibble is found at the top of the column, it is 0111
the low order nibble is at the left of the row, it is 1110
the binary code for the right arrow is therefore 0111 1110 which gives 126 decimal
By the way your topic heading is a bit misleading. In LCD terms the 'custom characters' are the ones that you create yourself and access via addresses 0 through 7. You are dealing with a sort of 'extended' ASCII character set although not the more or less standard one associated with the IBM PC.
Don
thank you very much guys. Sorry about the misleading title.
I have just tested a few by converting with the windows built in calc. strange you cant put in leading 0's but I guess it just does not bother with them because they are not significant
many thanks
Leading zeros in a numerical constant indicate to the compiler that the number
is in 'octal' [0-7] instead of decimal [0-9]. This is part of the programming language.
-Rusty-