Sorry, let me explain a little more. I will try to explain this better tonight when I get home from work.
The basic conversion is:
Code:
Converting Between Decimal Degrees, Degrees, Minutes and Seconds, and Radians
(dd + mm/60 +ss/3600) to Decimal degrees (dd.ff)
dd = whole degrees, mm = minutes, ss = seconds
dd.ff = dd + mm/60 + ss/3600
Example: 30 degrees 15 minutes 22 seconds = 30 + 15/60 + 22/3600 = 30.2561
Decimal degrees (dd.ff) to (dd + mm/60 +ss/3600)
But division by 3600 does not work so well for PICs, so .......
Here are a couple ways of converting 15 minutes:
15minutes/60 = .25 degrees. Unfortunately PicBasicPro will round it off to 0, which we do not like.
So, if we change it to 15minutes*500/3=2500 (you'll notice this is the same as the first equation, only multiplied by 10000). We want whole numbers here, and we will need to add seconds to it in whole numbers too.
Here is one part of my minutes to degrees conversion, but I will try to make this a lot clearer tonight. char_A is the validity character in a gps string called gpsdata.
Code:
lathome_min = ((((gpsdata[char_A+9]-48)*10) + (gpsdata[char_A+10]-48))*5)/3 'lathome_min
Bookmarks