#!/usr/bin/env python
from ADCDACPi import ADCDACPi
import time
from math import log10,log
adcdac = ADCDACPi(1) #DAC gain (1 o 2)
adcdac.set_adc_refvoltage(3.3)
Rf = 10000.
c1 = 1.009249522e-03
c2 = 2.378405444e-04
c3 = 2.019202697e-07
V0=4.98

def thermistor_t(V):
     Rt = (V0/V-1)*Rf
     print(Rt)
     logR2 = log10(Rt)
     T = (1.0 / (c1 + c2*logR2 + c3*logR2**3));
     T = T - 273.15;
     return T
    
while True:
   print(adcdac.read_adc_voltage(2, 0))
   time.sleep(0.5)
   

74cbcc94ef93ae85f8c13de92e92f251460eb6ec
<mask token>


def thermistor_t(V):
    Rt = (V0 / V - 1) * Rf
    print(Rt)
    logR2 = log10(Rt)
    T = 1.0 / (c1 + c2 * logR2 + c3 * logR2 ** 3)
    T = T - 273.15
    return T


<mask token>

<mask token>
adcdac.set_adc_refvoltage(3.3)
<mask token>


def thermistor_t(V):
    Rt = (V0 / V - 1) * Rf
    print(Rt)
    logR2 = log10(Rt)
    T = 1.0 / (c1 + c2 * logR2 + c3 * logR2 ** 3)
    T = T - 273.15
    return T


while True:
    print(adcdac.read_adc_voltage(2, 0))
    time.sleep(0.5)

<mask token>
adcdac = ADCDACPi(1)
adcdac.set_adc_refvoltage(3.3)
Rf = 10000.0
c1 = 0.001009249522
c2 = 0.0002378405444
c3 = 2.019202697e-07
V0 = 4.98


def thermistor_t(V):
    Rt = (V0 / V - 1) * Rf
    print(Rt)
    logR2 = log10(Rt)
    T = 1.0 / (c1 + c2 * logR2 + c3 * logR2 ** 3)
    T = T - 273.15
    return T


while True:
    print(adcdac.read_adc_voltage(2, 0))
    time.sleep(0.5)

from ADCDACPi import ADCDACPi
import time
from math import log10, log
adcdac = ADCDACPi(1)
adcdac.set_adc_refvoltage(3.3)
Rf = 10000.0
c1 = 0.001009249522
c2 = 0.0002378405444
c3 = 2.019202697e-07
V0 = 4.98


def thermistor_t(V):
    Rt = (V0 / V - 1) * Rf
    print(Rt)
    logR2 = log10(Rt)
    T = 1.0 / (c1 + c2 * logR2 + c3 * logR2 ** 3)
    T = T - 273.15
    return T


while True:
    print(adcdac.read_adc_voltage(2, 0))
    time.sleep(0.5)

#!/usr/bin/env python
from ADCDACPi import ADCDACPi
import time
from math import log10,log
adcdac = ADCDACPi(1) #DAC gain (1 o 2)
adcdac.set_adc_refvoltage(3.3)
Rf = 10000.
c1 = 1.009249522e-03
c2 = 2.378405444e-04
c3 = 2.019202697e-07
V0=4.98

def thermistor_t(V):
     Rt = (V0/V-1)*Rf
     print(Rt)
     logR2 = log10(Rt)
     T = (1.0 / (c1 + c2*logR2 + c3*logR2**3));
     T = T - 273.15;
     return T
    
while True:
   print(adcdac.read_adc_voltage(2, 0))
   time.sleep(0.5)
   
