forked from frak/LightScythe
/
Interface.py
29 lines (23 loc) · 864 Bytes
/
Interface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate as LCD
from Config import Config
class Interface:
def __init__(self, busnum=-1, addr=0x20, debug=False):
self.lcd = LCD(busnum, addr, debug)
self.config = Config()
self.lcd.backlight(int(self.config.get('Display', 'Colour')))
self.lcd.clear()
def scytheHome(self):
self.display('<> Scythe L/R\n^v Choose image')
def chooseImage(self, imageName):
output = 'Image chosen:\n' + imageName
self.display(output)
def display(self, text):
self.lcd.display()
self.lcd.backlight(int(self.config.get('Display', 'Colour')))
self.lcd.clear()
self.lcd.message(text)
def buttons(self):
return self.lcd.buttons()
def off(self):
self.lcd.backlight(self.lcd.OFF)
self.lcd.noDisplay()