Reading GPS string

rshaver

New Member
I do not know if there is a problem with the simulator or if this is the way it works. But parsing the following string for speed only works if I do is as follows.

040302.663,A,3939.7,N,10506.6,W,120.27,358.86,200804,,*1A
This is a GPRMC string starting at the time.

serin 1,t2400,#w1,#w1,#w1,#w1,#w1,#w1,#w4
This is the line of code to get the speed. I have to leave out the variable for any alpha characters. If I try to grab the "A","N", or "W" the first character of number following is missed.

This does not work.
serin 1,t2400,#w1,#w1,b0,#w1,#w1,b0#w1,#w1,b0,#w4
I don't need the characters but just want to know if I am doing something wrong, is there a bug in the simulator, or is this the way it works.
 

Technical

Technical Support
Staff member
When you use # any non-numeric characters are ignored anyway. Therefore you do not specifically have to account for the A etc, they will simply be ignored as they are not 0-9 characters anyway.
 
Top