except PhidgetException as e:
        print("Phidget Exception %i: %s" % (e.code, e.details))
        print("Exiting....")
        exit(1)
    print("Exiting....")
    exit(1)

try:
    textLCD.setScreenIndex(0)

    #print("Writing to first row....")
    textLCD.setDisplayString(0, "Initialising...")
    sleep(2)

    textLCD.setBacklight(True)
    textLCD.setBrightness(128)

    #print("Writing to second row....")
    textLCD.setDisplayString(1, "Complete!")
    sleep(2)

except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)

print("Press Enter to quit....")

chr = sys.stdin.read(1)

print("Closing...")
コード例 #2
0
ファイル: srv_lcd.py プロジェクト: nomad-cam/ass-bot
#Wait for the device to attach
try:
    textLCD.waitForAttach(10000)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    try:
        textLCD.closePhidget()
    except PhidgetException as e:
        print("Phidget Exception %i: %s" % (e.code, e.details))
        print("Exiting....")
        exit(1)
    print("Exiting....")
    exit(1)    

textLCD.setBacklight(True)
textLCD.setBrightness(128)

print("lcd setup complete, ready for use")

context = zmq.Context()
lcd_receiver = context.socket(zmq.PULL)
#lcd_receiver.bind("ipc://lcd.ipc")
lcd_receiver.bind("ipc:///tmp/lcd.ipc")
print("PULL socket complete on ipc://lcd.ipc")
#message = {}

#The MEAT goes here...
#result = lcd_receiver.recv_json()

while True:
    print("going into forever loop mode")