fixed errors

This commit is contained in:
Tanaes 2022-01-08 22:15:01 -05:00
parent ef5f011e40
commit f496712c04
3 changed files with 38 additions and 36 deletions

View File

@ -44,13 +44,13 @@ gpio_fan = 22 # pin 15
## Display outputs
time_disp = {'type': 'TMC1637',
'pins': {'clock': 16, # pin 36
'data': 26}} # pin 37
temp_disp = {'type': 'TMC1637',
'pins': {'clock': 16,
'data': 26}} # pin 36, pin 37
time_disp = {'type': 'TMC1637',
'pins': {'clock': 20, # pin 38
'data': 21}} # pin 40
'pins': {'clock': 20,
'data': 21}} # pin 38, pin 40
gpio_dotstar_clk = 19 # pin 35
gpio_dotstar_dat = 13 # pin 33
@ -67,7 +67,7 @@ max31855 = 0
max31856 = 1
# see lib/max31856.py for other thermocouple_type, only applies to max31856
# uncomment this if using MAX-31856
thermocouple_type = MAX31856.MAX31856_K_TYPE
# thermocouple_type = MAX31856.MAX31856_K_TYPE
### Thermocouple Connection (using bitbang interfaces)
gpio_sensor_cs = 8 # pin 24

View File

@ -1,27 +1,30 @@
class TM1637(object):
def __init__(self,
clk_pin,
dat_pin):
def __init__(self,
clk_pin,
dat_pin):
self.clk_pin = clock_pin
self.dat_pin = dat_pin
self.clk_pin = clock_pin
self.dat_pin = dat_pin
try:
import tm1637
self.tm = tm1637.TM1637(clk=clk_pin,
dio=dat_pin)
def temp(self,
t):
self.tm.number(t)
try:
import tm1637
self.tm = tm1637.TM1637(clk=clk_pin,
dio=dat_pin)
except ImportError:
print('import failure')
def time(self,
h,
m):
self.tm.numbers(h, m, True)
def temp(self,
t):
self.tm.number(t)
def text(self,
text):
self.tm.show(text[0:4])
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])
self.tm.write([0, 0, 0, 0])

View File

@ -12,7 +12,7 @@ class Display(object):
pins):
if type == "TMC1637":
self.disp = TM1637(pins['clock']
self.disp = TM1637(pins['clock'],
pins['data'])
def temp(self, t):
@ -35,24 +35,23 @@ class OvenWatcher(threading.Thread):
self.started = None
self.recording = False
self.observers = []
threading.Thread.__init__(self)
self.daemon = True
self.oven = oven
self.start()
self.time_disp = None
self.temp_disp = None
try:
self.time_disp = Display(config.time_disp['type'],
config.time_disp['pins'])
except NameError:
self.time_disp = None
self.time_disp = False
try:
self.temp_disp = Display(config.temp_disp['type'],
config.temp_disp['pins'])
except NameErro:
self.temp_disp = None
except NameError:
self.temp_disp = False
threading.Thread.__init__(self)
self.daemon = True
self.oven = oven
self.start()
# FIXME - need to save runs of schedules in near-real-time