コード例 #1
0
try:
    if textLCD.getDeviceID()==PhidgetID.PHIDID_TEXTLCD_ADAPTER:
        textLCD.setScreenIndex(0)
        textLCD.setScreenSize(TextLCD_ScreenSize.PHIDGET_TEXTLCD_SCREEN_2x8)
    
    print("Writing to first row....")
    textLCD.setDisplayString(0, "Row 1")
    sleep(2)
    
    print("Writing to second row....")
    textLCD.setDisplayString(1, "Row 2")
    sleep(2)
    
    print("Adjusting contrast up....")
    textLCD.setContrast(255)
    sleep(2)
    
    print("Adjusting contrast down....")
    textLCD.setContrast(110)
    sleep(2)
    
    print("Turn on cursor....")
    textLCD.setCursor(True)
    sleep(2)
    
    print("Turn on cursor blink....")
    textLCD.setCursor(False)
    textLCD.setCursorBlink(True)
    sleep(2)
    
コード例 #2
0
try:
    if textLCD.getDeviceID() == PhidgetID.PHIDID_TEXTLCD_ADAPTER:
        textLCD.setScreenIndex(0)
        textLCD.setScreenSize(TextLCD_ScreenSize.PHIDGET_TEXTLCD_SCREEN_2x8)

    print("Writing to first row....")
    textLCD.setDisplayString(0, "Row 1")
    sleep(2)

    print("Writing to second row....")
    textLCD.setDisplayString(1, "Row 2")
    sleep(2)

    print("Adjusting contrast up....")
    textLCD.setContrast(255)
    sleep(2)

    print("Adjusting contrast down....")
    textLCD.setContrast(110)
    sleep(2)

    print("Turn on cursor....")
    textLCD.setCursor(True)
    sleep(2)

    print("Turn on cursor blink....")
    textLCD.setCursor(False)
    textLCD.setCursorBlink(True)
    sleep(2)