#include <pic/p16f877a.h>
#define FOSC_HZ 20000000

#define ROW0  PIN_B0
#define ROW1  PIN_B1
#define ROW2  PIN_B2
#define ROW3  PIN_B3
#define COL0  PIN_B4
#define COL1  PIN_B5
#define COL2  PIN_B6
#define COL3  PIN_B7

#include <uart.h>
#include <keypad4x4flex.h>
#include <delayms.h>

int main (void)
{
	char tmp;
	char INTRO[]="PRESIONA UNA TECLA\n";
	
	TRISB=0xFF;
	TRISC=0xFF;

	delayms(100);

	uart_open(SET_9600_8N1);
	set_pullup_portb(TRUE);
	uart_puts(INTRO);

	while(TRUE)
	{
		delayms(200);
		tmp = kbd_getchar();
		uart_putc(tmp);
	}
	return 0;
}
