Hi Arrrch,
I took a look at the references you mention explaining strings but it still does not explain how to read strings coming in from the serial port.
On a good note, I was able to isolate the variables of interest (after the second comma)
135.846,4.712,282.736
4.71
For now I am willing to settle to convert the second string in to a integer. The problem I ran in to is I'm unable to save the string of digits in to an array for later use.
if (sensor_stringcomplete) //if a string from the Atlas Scientific product has been received in its entirety
{
Serial.println(sensorstring); //use the hardware serial port to send that data to the PC
for (int i=6; i<11; i++)
{
Serial.print(sensorstring[i]);
int f = sensorstring[i].toInt();
}
Serial.println(" this is the string of interest");
sensorstring = ""; //clear the string buffer:
sensor_stringcomplete = false; //reset the flag used to tell if we have received a completed string from the Atlas Scientific product
}
Unfortunately
int f = sensorstring[i].toInt();
does not work. I would also assume it would be out of the scope to use this value outside the brackets.
If I simply use
int f = sensorstring.toInt();
it compiles but that is only the first string before the first comma.