Go Down

Topic: Gobetwino command structure (Read 486 times) previous topic - next topic

JayBee

I am confused by the structure of Gobetwino commands.  I am using the RFLIN command to retrieve a wav file line by line.

The Gobetwino manual gives the command in an Arduino sketch as Serial.println ("#S|NAME|[LINENR]#");

If I want the command to move down the lines in sequence it seems to me that I would create an int variable (say "a") and increment that as the LINENR.  However, if I make the command

Code: [Select]

Serial.println ("#S|NAME|[a]#");


Arduino sends exactly that with "a" where I want the line number to be.

I suspect that this is because everything in the command () is enclosed in "" and therefore is sent exactly that way.

Do I have to break the print lines into literals between "" and the sequencing variable outside of them?  Something like this:
Code: [Select]

Serial.print ("#S|NAME|[");
Serial.print (a);
Serial.println ("]#");


That seems pretty cumbersome to me but what do I know?  Is that it?

PaulS

Quote
Do I have to break the print lines into literals between "" and the sequencing variable outside of them?  Something like this:

Yes, you do.

Quote
That seems pretty cumbersome to me but what do I know?

You could use sprintf() to create a string, and send that string in one call.

MikMo

A wav file is a binary file, it has no "lines" so it will not work.

What are you trying to achieve ?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy