diff --git a/WelcomeScreen.py b/WelcomeScreen.py index 61c320f..b96b5c5 100644 --- a/WelcomeScreen.py +++ b/WelcomeScreen.py @@ -18,34 +18,34 @@ along with this program. If not, see . import time -""" -WelcomeScreen: - provide a simple welcome/startup screen -""" + class WelcomeScreen: def __init__(self, lcd): self.lcd = lcd - def show_welcome(self, loops=1): # loops says how often the Starting text goes through - if loops < 1: loops = 1 - padding = " " # 16 spaces - started_str = " Started! " + def show(self, cycles=1): # loops says how often the Starting text goes through + if cycles < 1: cycles = 1 + padding = " " * self.lcd.num_columns # as much spaces as padding as one display line is long + starting_str = "Starting..." + started_str = "Started!".center(self.lcd.num_columns) - for i in range(loops): - line1 = padding + "Starting..." + padding - line2 = " the Program " - for i in range(32): - self.lcd.putstr(line1[0:16]) + for i in range(cycles): + line1 = padding + starting_str + padding + line2 = "The Program!".center(self.lcd.num_columns) + for i in range(self.lcd.num_columns + len(starting_str)): + self.lcd.putstr(line1[0:self.lcd.num_columns]) self.lcd.move_to(0,1) - self.lcd.putstr(line2[0:16]) + self.lcd.putstr(line2[0:self.lcd.num_columns]) line1 = line1[1:] self.lcd.move_to(0,0) self.lcd.putstr(started_str) - + # now fade down - time.sleep(2) + time.sleep(1) self.lcd.move_to(0,0) self.lcd.putstr(padding + started_str) time.sleep(0.1) self.lcd.clear() + time.sleep(0.3) +