Update GPS_HAT.py

This commit is contained in:
tpollina 2019-12-08 12:15:09 -08:00 committed by GitHub
parent 601a95e9d4
commit 13d3a1e8b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,28 +35,28 @@ if __name__ == '__main__':
os.system('clear')
print
print ' GPS reading'
print '----------------------------------------'
print 'latitude ' , gpsd.fix.latitude
print 'longitude ' , gpsd.fix.longitude
print 'time utc ' , gpsd.utc,' + ', gpsd.fix.time
print 'altitude (m)' , gpsd.fix.altitude
print 'eps ' , gpsd.fix.eps
print 'epx ' , gpsd.fix.epx
print 'epv ' , gpsd.fix.epv
print 'ept ' , gpsd.fix.ept
print 'speed (m/s) ' , gpsd.fix.speed
print 'climb ' , gpsd.fix.climb
print 'track ' , gpsd.fix.track
print 'mode ' , gpsd.fix.mode
print
print 'sats ' , gpsd.satellites
print ()
print (' GPS reading')
print ('----------------------------------------')
print ('latitude ' , gpsd.fix.latitude)
print ('longitude ' , gpsd.fix.longitude)
print ('time utc ' , gpsd.utc,' + ', gpsd.fix.time)
print ('altitude (m)' , gpsd.fix.altitude)
print ('eps ' , gpsd.fix.eps)
print ('epx ' , gpsd.fix.epx)
print ('epv ' , gpsd.fix.epv)
print ('ept ' , gpsd.fix.ept)
print ('speed (m/s) ' , gpsd.fix.speed)
print ('climb ' , gpsd.fix.climb)
print ('track ' , gpsd.fix.track)
print ('mode ' , gpsd.fix.mode)
print ()
print ('sats ' , gpsd.satellites)
time.sleep(5) #set to whatever
except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
print "\nKilling Thread..."
print ("\nKilling Thread...")
gpsp.running = False
gpsp.join() # wait for the thread to finish what it's doing
print "Done.\nExiting."
print ("Done.\nExiting.")