This given below code is not printing number greater than 10, for the first time if I entered 10,12,23,45,1234,..... it get stuck, second time it print repeating number(1010, 1212,2323,...).The entered number even very large number(1,2,10,23,100,230,500,1000,123234,112323435,....). when I entered single digit number, after entering digit greater than 10. It will work. For single digit number it is working.
Any suggestion would be appreciated?
Code: Select all
UART1_Init(9600); // Initialize the UART with a baud rate of 9600
while(1) {
if(UART1_Data_Ready() == 1) {
memset(input_num, 0, 25);
memset(output_num, 0, 25);
UART1_Read_Text(input_num, ";", 24);
sprintf(output_num,"%s\r\n", input_num);
}
UART1_Write_Text(output_num);
Delay_ms(500);
}
Kumar