program keylcd
dim keypadPort as byte at PORTD
dim LCD_RS as sbit at RC4_bit
LCD_EN as sbit at RC5_bit
LCD_D4 as sbit at RC0_bit
LCD_D5 as sbit at RC1_bit
LCD_D6 as sbit at RC2_bit
LCD_D7 as sbit at RC3_bit
LCD_RS_Direction as sbit at TRISC4_bit
LCD_EN_Direction as sbit at TRISC5_bit
LCD_D4_Direction as sbit at TRISC0_bit
LCD_D5_Direction as sbit at TRISC1_bit
LCD_D6_Direction as sbit at TRISC2_bit
LCD_D7_Direction as sbit at TRISC3_bit
dim Display as string[7]
dim kp as byte
main:
ADCON1 = 7
CMCON = 7
LCD_Init()
Keypad_Init()
LCD_Cmd(_LCD_CURSOR_OFF)
LCD_Cmd(_LCD_CLEAR)
while true
kp = 0
while (kp = 0)
kp = Keypad_Key_Click()
wend
select case kp
case 14
Display = "NORMAL "
case 1
Display = "FIX "
case 3
Display = "LEAKAGE"
end select
LCD_Out(1, 1, Display)
wend
end.