Added the WelcomeScreen library

This commit is contained in:
2024-10-28 21:09:23 +01:00
parent bd396913fe
commit 355821a6a9
3 changed files with 137 additions and 37 deletions

14
main.py
View File

@@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with thi
import config, utils
from lib.ProgramChooserAdapted import ProgramChooser
from lib.WelcomeScreen import WelcomeScreen
from time import sleep
import gc # garbage collector for better memory performance
@@ -61,10 +62,17 @@ programs = {
"UV on": uv_on,
"Timer": timer,
"Manual": manual,
}
}
if config.STARTUP_WELCOME_SHOW: utils.show_welcome()
if config.STARTUP_WELCOME_SHOW:
ws = WelcomeScreen(config.LCD,
interrupt_pins=[config.BTN_1, config.BTN_2, config.SWITCH],
subtitle=config.STARTUP_PROJECT_NAME,
starting_msg=config.STARTUP_MESSAGE_STARTING,
started_msg=config.STARTUP_MESSAGE_FINISHED)
ws.show(cycles=config.STARTUP_WELCOME_CYCLES)
del ws
gc.collect()
pc = ProgramChooser(programs) # initialize the ProgramChooser
pc.run() # and run it (will be an endless loop)