ahmedragia21
Member
Hi , i'd like to recieve a string for example an AT phone , like it sends ERROR when i send a wrong AT Command , i wanna display this to an LCD , much like what hyper terminal does , the problem is i only know how to recieve a charachter , tried this code , it works but i wonder how this works lcd_puts(&array[0]);
but it always prints the string with vague charachters .
but it always prints the string with vague charachters .
Code:
// for recieve the string
char Ch;
// Only dealing with received bytes here
// -> Just check the RI flag
i=0;
while(Ch!='\r')
{
Ch=SBUF;
array[i]=Ch;
while(!RI);
RI = 0; // Clear RT flag
i++;
}
//for print
lcd_puts(&array[0]);
void lcd_puts(char *aaa){
unsigned int i=0;
for(;aaa[i]!=0;i++)lcd_data(aaa[i]);
}
Last edited: