From e5f45ff593f0f59d92b8b81f8e89a00ac6c61d9f Mon Sep 17 00:00:00 2001 From: BlueFox Date: Mon, 28 Oct 2024 17:08:46 +0000 Subject: [PATCH] [WelcomeScreen.py] prepared for interrupt support; includes the commit string of the last commit - finally got the fade out animation support 4*20 LCDs too (in theory, couldn't test that sadly) - prepared for interrupt support, by adding a list parameter with pins --- WelcomeScreen.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/WelcomeScreen.py b/WelcomeScreen.py index 0ba5d17..12c1950 100644 --- a/WelcomeScreen.py +++ b/WelcomeScreen.py @@ -22,13 +22,21 @@ import time class WelcomeScreen: # __init__() - the constructor # lcd: an object of I2C_LCD (from the PCF8574T library - https://git.privacynerd.de/BlueFox/micropython-libraries/src/branch/main/PCF8574T) + # --- + # interrupt_pins: a list containing machine.Pin objects exclusively (but if you give these you can still turn interrupting off + # via a parameter in the show method (see below!) + # --- # subtitle: the text shown below the cycling text (e.g. the device's name, ...) (Lorem ipsum. by default) + # --- # starting_msg: the text shown while cycling (default: Starting...) + # --- # started_msg: the text shown while cycling (default: Started!) - def __init__(self, lcd, subtitle="Lorem ipsum.", starting_msg="Starting...", started_msg="Started!"): + def __init__(self, lcd, interrupt_pins=None, subtitle="Lorem ipsum.", starting_msg="Starting...", started_msg="Started!"): self.lcd = lcd self.columns = self.lcd.num_columns self.lines = self.lcd.num_lines + + self.interrupt_pins = interrupt_pins self.subtitle = subtitle self.starting_msg = starting_msg self.started_msg = started_msg