In order to write multiple bytes via USART, we have to create a loop and new variables just for that process:
Code: Select all
char i;
char temp;
char *ptr;
void main() {
Usart_Init(9600);
while(1){
ptr = "Hello";
temp = strlen(ptr);
for(i=1; i<=temp; i++){
Usart_write(*ptr);
ptr++; }
delay_ms(1000);
}
}
Code: Select all
USART_Write_Text("Hello")
Thanks!
pinout