From bc962e17cb1fb9257b0278c202c034fe42cd4c27 Mon Sep 17 00:00:00 2001 From: Martin Woodward Date: Mon, 23 Dec 2024 18:04:11 +0000 Subject: [PATCH] Clear screen before network call delay --- examples/word_clock.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/word_clock.py b/examples/word_clock.py index 67206ba..f8b1a61 100644 --- a/examples/word_clock.py +++ b/examples/word_clock.py @@ -9,6 +9,14 @@ presto = Presto() display = presto.display WIDTH, HEIGHT = display.get_bounds() +BLACK = display.create_pen(0, 0, 0) +WHITE = display.create_pen(200, 200, 200) +GRAY = display.create_pen(30, 30, 30) + +# Clear the screen before the network call is made +display.set_pen(BLACK) +display.clear() +presto.update() # Length of time between updates in minutes. UPDATE_INTERVAL = 15 @@ -24,11 +32,6 @@ # Set the correct time using the NTP service. ntptime.settime() -BLACK = display.create_pen(0, 0, 0) -WHITE = display.create_pen(200, 200, 200) -GRAY = display.create_pen(30, 30, 30) - - def approx_time(hours, minutes): nums = {0: "twelve", 1: "one", 2: "two", 3: "three", 4: "four", 5: "five", 6: "six",