I'm a real newbie at sketch writing and programming and as such, it is difficult to search for answers as I'm not sure of the correct terminology to look for!
So.... I have a serial input that is delimited by commas and comprises alpha and numeric content, but essentially is all ASCII text - it is in fact an NMEA0183 'sentence' of data.
Example
$WIMWV,007,R,4.1,N,A*3F
I want to extract the numerical value of the text field after the first comma (007 in this example) and that after the 3rd comma (4.1 in the example)
I cannot do this by simply choosing the 'nth character as the number of characters can vary - for example the field that is 4.1 in this example, could easily be 12.5, so counting the position, by number of characters within the string, does not work.
Essentially I need a way to to extract the part of the string between two specified commas and then convert it to a number. (using toint or tofloat, I assume)
The reason I wish to do this is that this input gives wind speed and wind direction. I wish to save the maximum wind speed experienced from start of running the sketch. (adding an ability to re-set it with a suitable key switch). I also wish to output the speed and direction value to an LCD display.
But I am stuck at how to extract the two values I need, consistently, and convert it to numbers rather than text.