Hey guys,
so i created this code
ignoring the while loop and the other functions. I would like to simplify my char string and somehow turn it into a function. I'm using putty to read the usart code.
I want it so that i can write as many characters as I want without having to change the number of the integer [(i)(i<11)]. Eg. send out "Hello world, blah blah." without having to type down the how many characters there are (does/calculate it automatically). Hopefully that makes sense.
Thanks!
so i created this code
Code:
int main(void)
{
// PLL_Config();
SystemCoreClockUpdate();
char string[]= "Hello World";
int i=0;
while(!(USART_MODULE->SR&USART_SR_RXNE))
for (i=0; i<11; i++)
{
init_USART();
send_usart(string[i]);
}
while (string[i]!=0);
I want it so that i can write as many characters as I want without having to change the number of the integer [(i)(i<11)]. Eg. send out "Hello world, blah blah." without having to type down the how many characters there are (does/calculate it automatically). Hopefully that makes sense.
Thanks!