try: gps.closePhidget() except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) print("Exiting....") exit(1) print("Exiting....") exit(1) else: displayDeviceInfo() print("Press Enter to quit....") try: print("GPS Current Time: %s" % (gps.getTime().toString())) print("GPS Current Date: %s" % (gps.getDate().toString())) print("GPS Current Latitude: %F" % (gps.getLatitude())) print("GPS Current Longitude: %F" % (gps.getLongitude())) print("GPS Current Altitude: %F" % (gps.getAltitude())) print("GPS Current Heading: %F" % (gps.getHeading())) print("GPS Current Velocity: %F" % (gps.getVelocity())) except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) chr = sys.stdin.read(1) print("Closing...") try: gps.closePhidget() except PhidgetException as e:
atexit.register(clean_up) gps = None try: gps = GPS() gps.openPhidget() gps.waitForAttach(10000) except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) exit(1) print("Date,Time,Lat,Long,Altitude,Velocity,Heading") while True: try: print("{0},{1},{2},{3},{4},{5},{6}".format( gps.getDate().toString(), gps.getTime().toString(), gps.getLatitude(), gps.getLongitude(), gps.getAltitude(), gps.getVelocity(), gps.getHeading(), )) except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) time.sleep(.02)
try: gps.closePhidget() except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) print("Exiting....") exit(1) print("Exiting....") exit(1) else: displayDeviceInfo() print("Press Enter to quit....") try: print("GPS Current Time: %s" %(gps.getTime().toString())) print("GPS Current Date: %s" %(gps.getDate().toString())) print("GPS Current Latitude: %F" %(gps.getLatitude())) print("GPS Current Longitude: %F" %(gps.getLongitude())) print("GPS Current Altitude: %F" %(gps.getAltitude())) print("GPS Current Heading: %F" %(gps.getHeading())) print("GPS Current Velocity: %F" % (gps.getVelocity())) except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) print("Press Enter to quit....") # DO SOMETHING HERE # # Set digital output port 0 to be on
try: gps.closePhidget() except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) print("Exiting....") exit(1) print("Exiting....") exit(1) else: displayDeviceInfo() print("Press Enter to quit....") try: print("GPS Current Time: %s" % (gps.getTime().toString())) print("GPS Current Date: %s" % (gps.getDate().toString())) print("GPS Current Latitude: %F" % (gps.getLatitude())) print("GPS Current Longitude: %F" % (gps.getLongitude())) print("GPS Current Altitude: %F" % (gps.getAltitude())) print("GPS Current Heading: %F" % (gps.getHeading())) print("GPS Current Velocity: %F" % (gps.getVelocity())) except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) chr = sys.stdin.read(1) print("Closing...") try: gps.closePhidget() except PhidgetException as e:
try: gps.closePhidget() except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) print("Exiting....") exit(1) print("Exiting....") exit(1) else: displayDeviceInfo() print("Press Enter to quit....") try: print("GPS Current Time: %s" % (gps.getTime().toString())) print("GPS Current Date: %s" % (gps.getDate().toString())) print("GPS Current Latitude: %F" % (gps.getLatitude())) print("GPS Current Longitude: %F" % (gps.getLongitude())) print("GPS Current Altitude: %F" % (gps.getAltitude())) print("GPS Current Heading: %F" % (gps.getHeading())) print("GPS Current Velocity: %F" % (gps.getVelocity())) except PhidgetException as e: print("Phidget Exception %i: %s" % (e.code, e.details)) print("Press Enter to quit....") # DO SOMETHING HERE # # Set digital output port 0 to be on #interfaceKit.setOutputState(0, 1) #import time