예제 #1
0
    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:
예제 #2
0
파일: gps_logger.py 프로젝트: cyface/boxbot
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)

예제 #3
0
    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
예제 #4
0
    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:
예제 #5
0
    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