Hey people,
Im working with NMEA sentences and am having trouble parsing them. The NMEA sentence is delimited by commas. So, I have to parse this line and store the data inbetween the commas.
i.e. ,temp,temp1,temp2,,
The problem is I am using a program called wiz-c to do this and it does not have methods normally made available in C++.
So I have came up with this bit of code
Code:
skipComma(1); // skips the first comma
ch=WaitRx(); // reads data into a temp ch variable
if(ch!=',') // if ch does not equal comma then
{
data=ch; // Store ch in variable called data
}
else
{
data='' // If ch does equal comma then set data to nothing
}
I have to do this 10-15 times and record the data in each field.
This doesnt seem to work, anyone got any ideas?