Code: Select all
char rs_in,
rs_disp[3]
UART1_Init(2400);
while(1)
{
while (UART1_Data_Ready() == 1)
{
rsin = UART1_Read();
timeout_counter=0; // on a reçu data
bytetohex(rsin,rs_disp);
if (ndatain==8)
{
ndatain=0;
Lcd_Out (2,1,"");
}
Lcd_Out_cp(rs_disp);
ndatain++;
}
if (++timeout_counter >=timeout)
{
timeout_counter=0;
Lcd_Out(2, 1, " ");
ndatain=0;
Lcd_Out(2, 1, "");
}
Delay_ms(1);
}
}
Thanks!