Esempio n. 1
0
try:
    interfaceKitLCD.setOnErrorhandler(InterfaceKitLCDError)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)      

#Open the textLCD
try:
    interfaceKitLCD.openRemote('odroid',serial=120517)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)    

if not interfaceKitLCD.isAttachedToServer():
    sleep(2)

print('interfaceKitLCD attached to server: %s' % interfaceKitLCD.isAttachedToServer())

#Wait for the device to attach
try:
    interfaceKitLCD.waitForAttach(10000)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    try:
        interfaceKitLCD.closePhidget()
    except PhidgetException as e:
        print("Phidget Exception %i: %s" % (e.code, e.details))
        print("Exiting....")
        exit(1)
Esempio n. 2
0
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)

print("Opening phidget object....")

try:
    # Open interfaceKit by serial number to avoid conflicts with future interface kits...
    # As displayed by displayDeviceInfo()
    interfaceKitLCD.openRemote('odroid', serial=120517)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)

if not interfaceKitLCD.isAttachedToServer():
    sleep(2)

print('interfaceKitLCD attached to server: %s' %
      interfaceKitLCD.isAttachedToServer())

#wait for the device to attach
try:
    interfaceKitLCD.waitForAttach(10000)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    try:
        interfaceKitLCD.closePhidget()
    except PhidgetException as e:
        print("Phidget Exception %i: %s" % (e.code, e.details))
        print("Exiting....")