hi all
im wondering if this is a legal thing to do.in the winavr documentation i read that using the printf and scanf functions eats code space and ram so i wrote my own function as follows:
void sendString(char data[])
{
unsigned char i;
for(i = 0 ; i == 34;i++)
{
while(!(UCSRA & (1<<UDRE)));//wait for data register to be empty
UDR = data[i];
if(data[i] == '\0')
return;
}
return;
}
no my question is that assuming the above code is happy, can i call the function like this:
sendString("Enter number of samples ");
or do i first have to stick that string into an array and then feed that to the
function?also will the compiler put a '\0 ' at the end of the string or do i have to figure out how to do that myself? is there anything else im missing?
thanks