kiln-controller/lib/display.py
2022-02-05 12:44:41 -05:00

31 lines
643 B
Python

class TM1637(object):
def __init__(self,
clk_pin,
dat_pin):
self.clk_pin = clk_pin
self.dat_pin = dat_pin
try:
import tm1637
self.tm = tm1637.TM1637(clk=clk_pin,
dio=dat_pin)
except ImportError:
print('import failure')
def temp(self,
t):
self.tm.number(t)
def time(self,
h,
m):
self.tm.numbers(h, m, True)
def text(self,
text):
self.tm.show(text[0:4])
def off(self):
self.tm.write([0, 0, 0, 0])