From be47d32940affd3219f09f1be9a75fbfbebeef01 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 27 Apr 2023 11:47:49 +0200 Subject: [PATCH] Display splash screen on app start --- src/apps/plant.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/apps/plant.py b/src/apps/plant.py index a7c543b..7f33dd0 100644 --- a/src/apps/plant.py +++ b/src/apps/plant.py @@ -1,6 +1,5 @@ import urequests import jpegdec -from pcf85063a import PCF85063A from badger2040 import ( WIDTH, @@ -246,8 +245,18 @@ def get_time(): return fix_dst(*display.rtc.datetime()) +def splash_screen(): + display.set_pen(WHITE) + display.clear() + display.set_pen(BLACK) + display.text("Starting plant app...", 10, 10, 300, 0.5) + display.set_update_speed(UPDATE_FAST) + display.update() + + while True: try: + splash_screen() main() except Exception as e: print(e)