Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import serial
  2. import socket
  3.  
  4. ser = serial.Serial('/dev/ttyUSB0', 4800, timeout=1)
  5. latitude = ''
  6. longitude = ''
  7. def readgps(latitude,longitude):
  8. """Read the GPG LINE using the NMEA standard"""
  9. while True:
  10. line = ser.readline()
  11. if "GPGGA" in line:
  12. latitude = line[18:26] #Yes it is positional info for lattitude
  13. longitude = line[31:39] #do it again
  14. return(latitude,longitude)
  15. print "Finished"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement