micronEC/welcome.py

30 lines
886 B
Python
Raw Normal View History

import time
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! "
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()