@@ -108,7 +108,7 @@ def __init__(self, pin):
108
108
with open ("/profiles/" + self .config ["profile" ] + ".json" , mode = "r" ) as fpr :
109
109
self .sprofile = json .load (fpr )
110
110
fpr .close ()
111
- i2c = busio .I2C (board .SCL , board .SDA , frequency = 200000 )
111
+ i2c = busio .I2C (board .SCL , board .SDA , frequency = 100000 )
112
112
try :
113
113
self .sensor = MCP9600 (i2c , self .config ["sensor_address" ], "K" )
114
114
self .ontemp = self .sensor .temperature
@@ -123,6 +123,10 @@ def __init__(self, pin):
123
123
self .reflow_start = 0
124
124
self .beep = Beep ()
125
125
self .set_state ("ready" )
126
+ if self .sensor_status :
127
+ if self .sensor .temperature >= 50 :
128
+ self .last_state = "wait"
129
+ self .set_state ("wait" )
126
130
127
131
def reset (self ):
128
132
self .ontime = 0
@@ -217,8 +221,7 @@ def check_state(self):
217
221
checktime += 5
218
222
if not checkoven :
219
223
# hold oven temperature
220
- if (self .state in ("start" , "preheat" , "soak" ) and
221
- self .offtemp > self .sensor .temperature ):
224
+ if self .state in ("start" , "preheat" , "soak" ) and self .offtemp > self .sensor .temperature :
222
225
checkoven = True
223
226
self .enable (checkoven )
224
227
@@ -375,7 +378,7 @@ def draw_profile(graph, profile):
375
378
# draw time line (horizontal)
376
379
graph .draw_line (graph .xmin , graph .ymin , graph .xmax , graph .ymin , AXIS_SIZE , 4 , 1 )
377
380
graph .draw_line (graph .xmin , graph .ymax - AXIS_SIZE , graph .xmax , graph .ymax
378
- - AXIS_SIZE , AXIS_SIZE , 4 , 1 )
381
+ - AXIS_SIZE , AXIS_SIZE , 4 , 1 )
379
382
# draw time ticks
380
383
tick = graph .xmin
381
384
while tick < (graph .xmax - graph .xmin ):
@@ -386,7 +389,7 @@ def draw_profile(graph, profile):
386
389
# draw temperature line (vertical)
387
390
graph .draw_line (graph .xmin , graph .ymin , graph .xmin , graph .ymax , AXIS_SIZE , 4 , 1 )
388
391
graph .draw_line (graph .xmax - AXIS_SIZE , graph .ymin , graph .xmax - AXIS_SIZE ,
389
- graph .ymax , AXIS_SIZE , 4 , 1 )
392
+ graph .ymax , AXIS_SIZE , 4 , 1 )
390
393
# draw temperature ticks
391
394
tick = graph .ymin
392
395
while tick < (graph .ymax - graph .ymin )* 1.1 :
@@ -497,6 +500,7 @@ def format_time(seconds):
497
500
last_state = "ready"
498
501
last_control = False
499
502
second_timer = time .monotonic ()
503
+ timer = time .monotonic ()
500
504
while True :
501
505
board .DISPLAY .refresh_soon ()
502
506
oven .beep .refresh () # this allows beeps less than one second in length
0 commit comments