' Keypad Test Remarks on Device 16F84 ' We are using a PIC16F84 Declare XTAL 4 ' And a 4MHz crystal Declare RSOUT_PIN PortA.0 ' Serial out at PORTB bit-0 Declare SERIAL_BAUD 9600 ' 9600 Baud Declare RSOUT_MODE Inverted ' Inverted Declare RSOUT_PACE 100 ' 100ms between characters sent Declare Keypad_Port PortB ' Connect the Keypad to PortB Dim Key as Byte ' Holds the key pressed ' ** THE MAIN PROGRAM LOOP STARTS HERE ** Rsout Cls ' Clear the Serial LCD Again: Key=Inkey ' Read the Keypad Delayms 50 ' Pause for 50ms to debounce Key=Lookup Key,[1,2,3,4,5,6,7,8,9,0,255,255,255,255,255,255,255] Rsout at 1,1,@Key," " ' Output the value of KEY Goto Again ' Do it forever