I know questions have been asked a lot on this function, but after searching for hours on here I cannot find an answer that helps me figure this out.
Here is the function to read in a string through the UART that I'm trying to implement.
void UART_Read_Text(char *Output, unsigned int length)
{
unsigned int i;
for(int i=0;i<length;i++)
Output[i] = UART_Read();
}
I have a 16 character array called label defined globally. I want to receive the UART data into this array.
Here is how I'm attempting to use it.
UART_Read_Text(label,16);
Can someone please shed some light on what I'm doing wrong? Keep in mind, I have UART TX function working well, so I have that set up properly. Also, I'm trying not to have to use interrupts, but maybe that is the way that I have to go. Any help would be appreciated.