Skip to content

Commit

Permalink
Merge pull request #23 from martinwoodward/worldclock-clear-screen-on…
Browse files Browse the repository at this point in the history
…-start

Woldclock: Clear screen before network call delay
  • Loading branch information
Gadgetoid authored Jan 9, 2025
2 parents a63ebc2 + bc962e1 commit 11b0acd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions examples/word_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down

0 comments on commit 11b0acd

Please sign in to comment.