Trouble reading GPS Values
Posted: August 28th, 2014, 1:14 pm
Hello everyone,
I been trying to get the latitude and longitude values on an Android device using the GPS function. I actually am able to read it, but I think there is something I´m doing wrong because it only returns Integer values. For example: latitude: 10.0000000, Longitude: -80.0000000 and I don´t know why the decimals that those values supose to have are taken by .0000000 and I actually confirm those values with my phone and actually I get for example: 10´25´´17 and 80´32´´12 at that same place. So maybe someone could help me to figure out why I can only get those values but the decimals are missing.
Thanks to everyone !!.
Here is what I been trying to do:
// ----- Getting your current Global Position -----
if gps(open) = 0 then
errmsg("The GPS unit is turned off, please turn it on.");
exit;
endif;
numeric li_latitude, li_longitude;
if gps(read,70) then // try to get a gps reading for up to 70 seconds
errmsg("Your actual position corresponds to:");
errmsg("Latitude: %f", li_latitude);
errmsg("Longitude: %f", li_longitude);
Here What I get is: Latitude: 10.0000000 then Longitude: -80.0000000 (For Example)
And I think what I supose to get is something like:
Latitude: 10.251700 then Longitude: -80.321200
else
errmsg("There has been an error while Reading gps, Try again later");
endif;
gps(close);
// ----- End getting your current Global Position -----
But I don´t know If I´m wrong or doing something wrong.
Thank you so much for everyone !!
I been trying to get the latitude and longitude values on an Android device using the GPS function. I actually am able to read it, but I think there is something I´m doing wrong because it only returns Integer values. For example: latitude: 10.0000000, Longitude: -80.0000000 and I don´t know why the decimals that those values supose to have are taken by .0000000 and I actually confirm those values with my phone and actually I get for example: 10´25´´17 and 80´32´´12 at that same place. So maybe someone could help me to figure out why I can only get those values but the decimals are missing.
Thanks to everyone !!.
Here is what I been trying to do:
// ----- Getting your current Global Position -----
if gps(open) = 0 then
errmsg("The GPS unit is turned off, please turn it on.");
exit;
endif;
numeric li_latitude, li_longitude;
if gps(read,70) then // try to get a gps reading for up to 70 seconds
errmsg("Your actual position corresponds to:");
errmsg("Latitude: %f", li_latitude);
errmsg("Longitude: %f", li_longitude);
Here What I get is: Latitude: 10.0000000 then Longitude: -80.0000000 (For Example)
And I think what I supose to get is something like:
Latitude: 10.251700 then Longitude: -80.321200
else
errmsg("There has been an error while Reading gps, Try again later");
endif;
gps(close);
// ----- End getting your current Global Position -----
But I don´t know If I´m wrong or doing something wrong.
Thank you so much for everyone !!