program LCD_Cust
dim LCD_RS as sbit at RB4_bit
LCD_EN as sbit at RB5_bit
LCD_D4 as sbit at RB0_bit
LCD_D5 as sbit at RB1_bit
LCD_D6 as sbit at RB2_bit
LCD_D7 as sbit at RB3_bit
LCD_RS_Direction as sbit at TRISB4_bit
LCD_EN_Direction as sbit at TRISB5_bit
LCD_D4_Direction as sbit at TRISB0_bit
LCD_D5_Direction as sbit at TRISB1_bit
LCD_D6_Direction as sbit at TRISB2_bit
LCD_D7_Direction as sbit at TRISB3_bit
const character as byte[8] = (0,10,0,21,17,14,0,0)
sub procedure CustomChar(dim pos_row as byte, dim pos_char as byte)
dim i as byte
LCD_Cmd(64)
for i = 0 to 7
LCD_Chr_Cp(character[i])
next i
LCD_Cmd(_LCD_RETURN_HOME)
LCD_Chr(pos_row, pos_char, 0)
end sub
main:
LCD_Init()
LCD_Cmd(_LCD_CURSOR_OFF)
LCD_Cmd(_LCD_CLEAR)
CustomChar(1, 6) 'Print custom character on row 1, column 6
while true
wend
end.