Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from datetime import datetime
- from engine.lib import lcd, temp
- config = lcd.LCD()
- def printWelcome():
- config.lcd_clear()
- config.lcd_display_string("System", 1)
- config.lcd_display_string("aktywny", 2)
- def printLong(self, string, row):
- config.lcd_clear()
- my_long_string = string
- my_long_string = my_long_string + " "
- config.lcd_display_string(my_long_string[:19], row)
- for i in range(0, len(my_long_string)):
- lcd_text = my_long_string[i:(i + 20)]
- config.lcd_display_string(lcd_text, row)
- time.sleep(0.3)
- # self.display.lcd_clear()
- def printTime():
- config.lcd_clear()
- config.lcd_display_string("ZEGAR:", 1)
- while True:
- data = datetime.now().strftime('%d.%m.%y %H:%M')
- config.lcd_display_string(data, 2)
- time.sleep(1)
- def printTemp(number, frequency):
- config.lcd_clear()
- config.lcd_display_string("TEMP:", 1)
- while True:
- x = round(temp.read_temp(), number)
- temperature = "{temp:." + str(number) + "f}"
- string = str(temperature.format(temp=x))
- config.lcd_display_string(string + " C", 2)
- time.sleep(frequency)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement