I'm trying to build a clock with an Adafruit 16x2 LCD and my RasPi B+ using Adafruit's tutorial. It works fine at first, but it will start displaying gibberish after a couple seconds. Any ideas as to what might be causing this?
The proper output is the current time and date in UTC (_ = space):
_ _ 10:12:13 _ UTC _ _ _ _ _ 12/25/2017 _ _ _
My code, based on the code in the tutorial:
#!/usr/bin/python from Adafruit_CharLCD import Adafruit_CharLCD from time import sleep, strftime from datetime import datetime lcd = Adafruit_CharLCD() lcd.begin(16, 1) while 1: lcd.clear() lcd.message(datetime.utcnow().strftime(' %T UTC\n')) lcd.message(datetime.utcnow().strftime(' %m/%d/%Y')) sleep(1)