Thanks @michinyon, but I'm not quite sure how to implement it into the code. Here is what I have so far:
String command; // the command string
String title; // the title string *This is the string I'm after!*
void setup() {
Serial.begin(115200); // start serial at 115200
pinMode(13, OUTPUT); // an indicator for debugging
Serial.println("Ready."); // indicate that we are connected and ready to go
}
void loop() {
if (Serial.available()) { // when the serial port is available
char c = Serial.read(); // read the characters
if (c == '\n') { // if there is a new line
parseCommand(command); // go and parse the command string
command = ""; // after the command is parsed, reset it
}
else { // if the command is not parsed yet (no new line),
command += c; // keep adding to the command string
}
Serial.println(title); // print the title string
}
}
void parseCommand(String com) {
fun_a("TITLE:", "\n");
}
int fun_a( char* string, char* substring )
{
}
int fun_b ( char* string, char* substring1, char* substring2 )
{
int p= fun_a( string, substring1 );
int q = fun_a( string, substring2 );
if ( p >= 0 && q >=0 && q>p ) return p ;
else return -1 ;
}
I have tried a few different things, but all I get is blank output with a new line feed. Thanks for the help again, I will understand this!