2023-10-31 22:17:39 +00:00
|
|
|
import time
|
|
|
|
|
|
|
|
class WelcomeScreen:
|
2023-11-02 17:01:51 +00:00
|
|
|
def __init__(self, lcd):
|
|
|
|
self.lcd = lcd
|
2023-10-31 22:17:39 +00:00
|
|
|
|
|
|
|
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! "
|
|
|
|
|
|
|
|
for i in range(loops):
|
|
|
|
line1 = padding + "Starting..." + padding
|
|
|
|
line2 = " micronEC "
|
|
|
|
for i in range(32):
|
|
|
|
self.lcd.putstr(line1[0:16])
|
|
|
|
self.lcd.move_to(0,1)
|
|
|
|
self.lcd.putstr(line2[0:16])
|
|
|
|
line1 = line1[1:]
|
|
|
|
|
|
|
|
self.lcd.move_to(0,0)
|
|
|
|
self.lcd.putstr(started_str)
|
|
|
|
|
|
|
|
# now fade down
|
|
|
|
time.sleep(2)
|
|
|
|
self.lcd.move_to(0,0)
|
|
|
|
self.lcd.putstr(padding + started_str)
|
|
|
|
time.sleep(0.1)
|
|
|
|
self.lcd.clear()
|