AnsweredAssumed Answered

convert char to double , GPS DATA

Question asked by merida.diego on Mar 20, 2016
Latest reply on Mar 20, 2016 by Clive One
I'm using the stm32f0 nucleo  and a gps module , I am able to receive data from the gps and i get the string below.
                                                                                
$GPGGA,000055.600,2853.3835,N,08113.7310,W,1,6,1.59,22.9,M,-31.3,M,,*59 

I used the following code to extract the latitud and longitud

char latitud[10];
 char longitud[10];

strncpy(latitud,in+18,9);
strncpy(longitud,in+30,9);

and i get this  :2853.3835  
                        08113.731¥ 
My question is how can I converter these char to doubles so i can manipulated the numbers and calculate the distance to another coordinate.

Any help or tip would be very appreciated, this is my first time working with microntrollers. In resume all I want is get my current location and calculate the distance to another coordinate using the haversine formula. Thank you so much


Outcomes