def get_temp(self): adc_read = spireader.adc_read(self.adc_channel) volts = spireader.adc_to_volts(adc_read) temp = 0 if volts: temp_c = (volts - 0.5) * 100.0 temp = temp_c * 1.8 + 32.0 print volts return temp
def sample(self): self.adc_sample_total += spireader.adc_read(self.adc_channel) self.adc_sample_count += 1