Pages: [1]   Go Down
Author Topic: Gobetwino command structure  (Read 444 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
Serial.print ("#S|NAME|[");
Serial.print (a);
Serial.println ("]#");

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 654
Posts: 50931
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

What are you trying to achieve ?
Logged

Pages: [1]   Go Up
Jump to: