I have yet to see anything concise (IMHO) as to how one goes about splitting a String into more than 2 places so that each substring as it were can be printed to the Serial monitor accordingly.
And here's something for the code-snippets page...
// Split string into five values - HOW??????????
for (int i = 0; i < str_out.length(); i++ ) {
if (str_out.substring(i, i + 1) == ",") {
str_Ctemp1 = str_out.substring(0, i);
str_Ftemp1 = str_out.substring(i + 1);// I got lost from here on down up to but limited by break;
str_Ctemp2 = str_out.substring(1, i); // Definitely wrong...
str_Ftemp2 = str_out.substring(i + i); // Definitely wrong...
str_humid = str_out.substring(2, i); // Definitely wrong...
break;
}
}
// Print values to Serial Monitor
Serial.print("C = ");
Serial.println(str_Ctemp1);
Serial.print("F = ");
Serial.println(str_Ftemp1);
Serial.print("C2 = ");
Serial.println(str_Ctemp2);
Serial.print("F2 = ");
Serial.println(str_Ftemp2);
Serial.print("Hum = ");
Serial.println(str_humid);
If the entire code(s) are needed for clarity on your part, then I can provide that as well.
Any pointing in the right direction is appreciated.