2016-03-19 05:17 PM
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 longitudchar 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 #gps2016-03-19 08:25 PM
The longitude contains more characters, perhaps you want some bigger buffers. I'd parse the fields, not all receiver have the same character indexes, especially if they report time or position with more accuracy.
The C on the micro-controller, is the same as a PC, in regard to what you are trying to do. Suggest you experiment there first with the example sentences. You can use the same sscanf() commands to do ''%lf'' doubles. With NMEA latitude and longitude, you need to decompose the numbers to get decimal degrees, as the numbers here are a mix of degrees and seconds. You also need to pay attention to the hemisphere each is in.2018-12-26 10:44 AM
More broken stuff? Hope you didn't pay the people who did the porting job.. @brk
2018-12-30 04:23 AM
@Community member as you can see from the link which contains STe2ecommunities, this was a bad link from the first migration from SharePoint to Jive. The correct link is here: https://community.st.com/s/question/0D50X00009Xkh8gSAB/issue-with-usart-rx-buffer-and-char-filter