コード例 #1
0
    sleep(2)
    
    print("Clear the screen...")
    textLCD.setCursorBlink(False)
    textLCD.setDisplayString(0, "")
    textLCD.setDisplayString(1, "")
    sleep(2)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)

try:
    print("Display some custom characters...")
    print("Set the custom chars....")
    textLCD.setCustomCharacter(0, 949247, 536)
    textLCD.setCustomCharacter(1, 1015791, 17180)
    textLCD.setCustomCharacter(2, 1048039, 549790)
    textLCD.setCustomCharacter(3, 1031395, 816095)
    textLCD.setCustomCharacter(4, 498785, 949247)
    textLCD.setCustomCharacter(5, 232480, 1015791)
    textLCD.setCustomCharacter(6, 99328, 1048039)
    print("Display the custom chars....")
    textLCD.setDisplayString(0, "Custom..")
    customString = textLCD.getCustomCharacter(0)
    customString += textLCD.getCustomCharacter(1)
    customString += textLCD.getCustomCharacter(2)
    customString += textLCD.getCustomCharacter(3)
    customString += textLCD.getCustomCharacter(4)
    customString += textLCD.getCustomCharacter(5)
    customString += textLCD.getCustomCharacter(6)
コード例 #2
0
    sleep(2)

    print("Clear the screen...")
    textLCD.setCursorBlink(False)
    textLCD.setDisplayString(0, "")
    textLCD.setDisplayString(1, "")
    sleep(2)
except PhidgetException as e:
    print("Phidget Exception %i: %s" % (e.code, e.details))
    print("Exiting....")
    exit(1)

try:
    print("Display some custom characters...")
    print("Set the custom chars....")
    textLCD.setCustomCharacter(0, 949247, 536)
    textLCD.setCustomCharacter(1, 1015791, 17180)
    textLCD.setCustomCharacter(2, 1048039, 549790)
    textLCD.setCustomCharacter(3, 1031395, 816095)
    textLCD.setCustomCharacter(4, 498785, 949247)
    textLCD.setCustomCharacter(5, 232480, 1015791)
    textLCD.setCustomCharacter(6, 99328, 1048039)
    print("Display the custom chars....")
    textLCD.setDisplayString(0, "Custom..")
    customString = textLCD.getCustomCharacter(0)
    customString += textLCD.getCustomCharacter(1)
    customString += textLCD.getCustomCharacter(2)
    customString += textLCD.getCustomCharacter(3)
    customString += textLCD.getCustomCharacter(4)
    customString += textLCD.getCustomCharacter(5)
    customString += textLCD.getCustomCharacter(6)