DEVICE=18f2420
CLOCK = 8 ' Tell the compiler what we will be setting the clock to (Mhz)
CONFIG MCLRE = OFF
'CONFIG fOSC = INTIO67 ' Internal oscillator, IO on pins 6 and 7
'INCLUDE "INTOSC8.bas"
'config "InternalOscillator.bas"
'#option LCD_DATA = PORTC.4
'#option LCD_RS = PORTC.0
'#option LCD_EN = PORTC.1
INCLUDE "SetDigitalIO.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
INCLUDE "utils.bas"
INCLUDE "convert.bas" //xxxxx
'INCLUDE "LCD.bas"
INCLUDE "keypad16pullup.bas"
INCLUDE "usart.bas"
DIM Keypressed AS BYTE
DIM Keyvalue AS BYTE
SetBaudrate(br4800)
DELAYMS(5000)
USART.Write ("Test program",13, 10, 10)
WHILE 1 = 1
Keypressed = keypad16.Value
IF Keypressed <> 0 THEN
USART.Write ("Key pressed = ", HexToStr(Keypressed), 13, 10)
END IF
WEND