DEVICE = 18F4321
CLOCK = 8
CONFIG MCLRE = off
// some LCD options...
#option KEYPAD_PORT = PORTB
#option LCD_DATA = PORTD.4
#option LCD_RS = PORTd.0
#option LCD_EN = PORTd.1
// import LCD library...
INCLUDE "SetDigitalIO.bas"
INCLUDE "IntOSC8.bas"
INCLUDE "LCD.bas"
INCLUDE "utils.bas"
INCLUDE "Keypad16pullup.bas"
INCLUDE "LCD.bas"
INCLUDE "Convert.bas"
DIM led AS porte.0
DIM KeyVal AS BYTE
DIM keypressed AS BYTE
DELAYMS(5000)
WriteAt(1,1,"Test Begin")
WHILE True
keypressed = Keypad16.Value
IF keypressed<>0 THEN
DELAYMS(50)
WriteAt(2,1,"Key: ",DecToStr(keypressed,2))//, " Cnt: "))//,DecToStr(Counter,2))
END IF
WEND