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

#include <uart.h>
#include <pinio.h>   /*define los PIN_XY*/
#include <delayms.h>

int main (void)
{
	char c=0;
	char INTRO[8]="TECLEA\n";
	int T=100;
	
	delayms(100);

	uart_open(SET_115200_8N1);

	uart_puts(INTRO);
	while(c!=13)
	{
		if(uart_kbhit()==1)
		{
			c=uart_getc()-'0';
			uart_putc(c+'0');
			T=100*c;
		}
		delayms(T);
		output_high(PIN_C2);
		delayms(T);
		output_low(PIN_C2);
	}
	uart_close();

	return 0;
}
