OBLCD_GCRAM pppp
Need a character not in the character set of the alpha-numeric LCD? Then why not make your own. The LCD module has memory inside it for up to 6 user defined characters. This memory is lost when the power goes off, so it needs to be loaded each time your program runs. You can even change these characters on the fly if you want to.
Using this instruction and a table of data located in NVEM. You can then print your special characters using the normal LCD print instructions. Each character cell on the LCD screen is made up of an 5 x 8 pixel matrix. A “1” in the spot for a particular pixel turns the pixel on, a “0” turns it off.
Example
Let’s say that we want a down arrow and an up arrow. These are not included in the standard LCD character set. The following code will make the down arrow LCD character code 0 and the up arrow LCD character code 1. In our NVEM table, we have created the bit patterns for each arrow. If you blur your eyes, you can make out the shape of each graphic by looking at the “1”‘s:
OBLCD_GCRAM LCDCGdata ;set up special LCD characters
(other code...as required)
OBLCD_Text "Up",1," Down",0 ;display "Up↑ Down↓"
(other code...as required)
nvem0 ;tag signals NVEM data follows
LCDCGdata
;custom character 0, down arrow character cell data
NV0Byte %00100
NV0Byte %00100
NV0Byte %00100
NV0Byte %00100
NV0Byte %11111
NV0Byte %01110
NV0Byte %00100
NV0Byte %00000
;custom character 1, up arrow character cell data
NV0Byte %00100
NV0Byte %01110
NV0Byte %11111
NV0Byte %00100
NV0Byte %00100
NV0Byte %00100
NV0Byte %00100
NV0Byte %00000
;4 other characters could follow...