Initial commit of files

This commit is contained in:
2021-01-22 10:13:24 -05:00
parent c86648ed30
commit 8d69d4c2db
25 changed files with 781 additions and 0 deletions

24
Projects/GPS/python/test.py Executable file
View File

@ -0,0 +1,24 @@
#! /usr/bin/python3
from gps import *
import time
gpsd = gps(mode=WATCH_ENABLE|WATCH_NEWSTYLE)
print('latitude\tlongitude\ttime utc\t\taltitude\tepv\tept\tspeed\tclimb') # '\t' = TAB to try and output the data in columns.
try:
while True:
report = gpsd.next() #
if report['class'] == 'TPV':
out = ""
for i in ['lat','lon','time','alt','epv','ept','speed','climb']:
out += str(getattr(report,i,0.0)) + "\t"
print(out)
time.sleep(1)
except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
print("Done.\nExiting.")