Skip to content

Instantly share code, notes, and snippets.

@bazub
Created September 20, 2012 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bazub/3756099 to your computer and use it in GitHub Desktop.
Save bazub/3756099 to your computer and use it in GitHub Desktop.
GPGGA translated
while 1:
a=ser.readline()
pos=[]
k=0
STR=[]
for i in range (0,len(a)):
if a[i]==',':
pos.append(i)
k=k+1
for i in range(1,k):
STR.append(a[pos[i-1]+1:pos[i]])
if(a[:pos[0]]=="$GPGGA"):
x=str(int(STR[1][:-7]))+"d "+str(int(STR[1][-7:-5]))+"' "+str(float(STR[1][-4:])*6/1000)+'" '+STR[2]
y=str(int(STR[3][:-7]))+"d "+str(int(STR[3][-7:-5]))+"' "+str(float(STR[3][-4:])*6/1000)+'" '+STR[4]
handle = webbrowser.get()
handle.open_new_tab('http://maps.google.com/?q='+tomap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment