Hi there I want to take this print script, modify it as a label script and use it to print out the coordinates in my GUI Tkinter python program. I am using the SparkFun GPS-RTK Dead Reckoning pHAT GPS-16475. I have tried many ways but with no prevail. Please help me!
Thank you,
Gerard Faber.
import serial
from ublox_gps import UbloxGps
port = serial.Serial(‘/dev/serial0’, baudrate=38400, timeout=1)
gps = UbloxGps(port)
def run():
try:
print(“Listening for UBX Messages”)
while True:
try:
geo = gps.geo_coords()
print("Longitude: ", geo.lon)
print("Latitude: ", geo.lat)
print("Heading of Motion: ", geo.headMot)
except (ValueError, IOError) as err:
print(err)
finally:
port.close()
if name == ‘main’:
run()