heater: Move adc logic into Thermistor class

The Thermistor (and Linear) class should handle all the details of
reading the ADC values and converting them to temperatures.  So, move
that logic out of the Heater() class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-04-04 14:13:59 -04:00
parent 7e78b2665e
commit 0fc4f0946e
2 changed files with 51 additions and 35 deletions

View file

@ -62,7 +62,7 @@ class ControlAutoTune:
self.pwm_samples.append((read_time + heater.PWM_DELAY, value))
self.last_pwm = value
self.heater.set_pwm(read_time, value)
def adc_callback(self, read_time, temp):
def temperature_callback(self, read_time, temp):
self.temp_samples.append((read_time, temp))
if self.heating and temp >= self.heater.target_temp:
self.heating = False