- changed time step to one sec in config

- added sleep for simulations to accurately reflect a real run
This commit is contained in:
jbruce
2018-11-22 09:48:22 -05:00
parent e2ae5eac65
commit 3cc7c4a11b
3 changed files with 15 additions and 10 deletions
+7 -2
View File
@@ -64,7 +64,9 @@ class Oven (threading.Thread):
self.time_step = time_step
self.reset()
if simulate:
self.temp_sensor = TempSensorSimulate(self, 0.5, self.time_step)
self.temp_sensor = TempSensorSimulate(self,
self.time_step,
self.time_step)
if sensor_available:
self.temp_sensor = TempSensorReal(self.time_step)
else:
@@ -161,7 +163,10 @@ class Oven (threading.Thread):
else:
GPIO.output(config.gpio_heat, GPIO.HIGH)
time.sleep(self.time_step * value)
GPIO.output(config.gpio_heat, GPIO.LOW)
GPIO.output(config.gpio_heat, GPIO.LOW)
else:
#for runs that are simulations
time.sleep(self.time_step * value)
else:
self.heat = 0.0
if gpio_available: