Using:
Raspberry Pi 3B+, Raspberry PI OS (32 bit) with I2C activated
Python 3.9.2
SparkFun 20x4 SerLCD - RGB Backlight (Qwiic) LCD-16398
SparkFun Qwiic pHAT v2.0 for Raspberry Pi DEV-15945
Phat connected to the LCD via Qwiic cable
sparkfun-qwiic-serlcd library installed
sparkfun-qwiic-i2c drivers installed
The sparkfun example python program:
from future import print_function
import qwiic_serlcd
import time
import sys
def runExample():
print(“\nSparkFun Qwiic SerLCD Example 1\n”)
myLCD = qwiic_serlcd.QwiicSerlcd()
if myLCD.connected == False:
print(“The Qwiic SerLCD device isn’t connected to the system. Please check your connection”, \
file=sys.stderr)
return
myLCD.setBacklight(255, 255, 255) # Set backlight to bright white
myLCD.setContrast(5) # set contrast. Lower to 0 for higher contrast.
myLCD.clearScreen() # clear the screen - this moves the cursor to the home position as well
time.sleep(1) # give a sec for system messages to complete
myLCD.print(“Hello World!”)
counter = 0
while True:
print(“counter: %d” % counter)
myLCD.setCursor(0,1)
myLCD.print(str(counter))
counter = counter + 1
time.sleep(1)
if name == ‘main’:
try:
runExample()
except (KeyboardInterrupt, SystemExit) as exErr:
print(“\nEnding Example 1”)
sys.exit(0)
This program will run anywhere from a few seconds to 10 minutes and then fail with a Raspberry Pi OSError: [Errno 121] Remote error.
the i2cdetect -y 1 command shows the lcd is connected at the 0x72 address before and after the failure. after the failure, an additional address of 0X08 appears for a short time.