I just received my Inky pHat and Pi Zero WH and put it together to make a clock. I run an NTP server on another Raspberry Pi so the idea was that I could have a physically small clock with a good display that would keep time but would sync with the NTP Pi on a regular basis.
I cobbled together some code, tested the Inky and came to the conclusion that I would need to display text in black as red takes a little too long to refresh. Needless to say the tech is great and it works really well. The simple Python script gets fired by crontab every minute and updates the display.
Now, my issue/problem is that although the Inky refreshes in about 15 seconds, the script takes around 25 seconds to run. This is my code segment for localtime, where it refreshes from the Zero’s own clock:
def LocalTime():
Row1 = strftime('%a %d %b')
Row2 = strftime('%H:%M %z')
Row3 = 'Local Time ' + strftime('%Z')
inkyphat.text((x, 2), Row1, inkyphat.BLACK, font=font)
inkyphat.text((x, 38), Row2, inkyphat.BLACK, font=font)
inkyphat.text((x, 80), Row3, inkyphat.BLACK, font=smallfont)
inkyphat.show()
sys.exit
Any ideas how I can speed this up, or is 25 seconds a realistic time for this setup?