Float32Full is going to kill me!
Sniper King
Posts: 221
Here is the code:
Pub GetCoords
i:=0
· repeat until i==70
··· tv.str(gps.valid)
··· waitcnt(2000000+cnt)
··· i++
tv.str(string(13))
i:=0
bytemove(@lat,gps.latitude,9)···· ' Moves GPS coords into @LAT· DDMM.mmmm
bytemove(@lng,gps.longitude,10)·· [url=mailto:'@LNG]'@LNG[/url] DDDMM.mmmm
bytefill(@buf,0,65)············· 'Clear Buffer
tv.str(gps.latitude)············ 'Display Latitude
tv.str(string(13))
i:=0
·repeat until i==7··············· 'Put MM.mmmm into buffer
·· buf[noparse][[/noparse]i]:=lat[noparse][[/noparse]i+2]
·· i++
·tv.str(@buf)····················· 'Display minutes Latitude
·tv.str(string(13))
b:=FMT.atoi(@buf)··················· 'Format string data into floating decimal.
Y:=60.0···················
a:=fp.fdiv(b,Y)····················· '********* Problem Child!!!!! **************··· MM.mmmm / 60 and then add it to the··················
···································· ' whole decimal for DD.ddddd· below.
tv.dec(a)···························
i:=0
bytefill(@buf,0,64)··
·repeat until i==2
· buf[noparse][[/noparse]i]:=lat[noparse][[/noparse]i]
· i++
·B:=FMT.atoi(@buf)
·b:=b+a···························· 'B=DD.ddddd
The FP.FDIV isn't working and is hanging the code!·
A is LONG
B is LONG
Y is LONG
Help please
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.
Michael King
Application Engineer
R&D
Digital Technology Group
Pub GetCoords
i:=0
· repeat until i==70
··· tv.str(gps.valid)
··· waitcnt(2000000+cnt)
··· i++
tv.str(string(13))
i:=0
bytemove(@lat,gps.latitude,9)···· ' Moves GPS coords into @LAT· DDMM.mmmm
bytemove(@lng,gps.longitude,10)·· [url=mailto:'@LNG]'@LNG[/url] DDDMM.mmmm
bytefill(@buf,0,65)············· 'Clear Buffer
tv.str(gps.latitude)············ 'Display Latitude
tv.str(string(13))
i:=0
·repeat until i==7··············· 'Put MM.mmmm into buffer
·· buf[noparse][[/noparse]i]:=lat[noparse][[/noparse]i+2]
·· i++
·tv.str(@buf)····················· 'Display minutes Latitude
·tv.str(string(13))
b:=FMT.atoi(@buf)··················· 'Format string data into floating decimal.
Y:=60.0···················
a:=fp.fdiv(b,Y)····················· '********* Problem Child!!!!! **************··· MM.mmmm / 60 and then add it to the··················
···································· ' whole decimal for DD.ddddd· below.
tv.dec(a)···························
i:=0
bytefill(@buf,0,64)··
·repeat until i==2
· buf[noparse][[/noparse]i]:=lat[noparse][[/noparse]i]
· i++
·B:=FMT.atoi(@buf)
·b:=b+a···························· 'B=DD.ddddd
The FP.FDIV isn't working and is hanging the code!·
A is LONG
B is LONG
Y is LONG
Help please
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.
Michael King
Application Engineer
R&D
Digital Technology Group
Comments
check out Paul H's GoogleEarthLogger it does the same kind of arithmetic as you seem to want.
Perry
[noparse][[/noparse]code ]
[noparse][[/noparse]/code ]
(without spaces)
John Abshier