]>
vault307.fbx.one Git - mu_code.git/blob - thermistorTest.py
7 import adafruit_pcf8591
.pcf8591
as PCF
8 from adafruit_pcf8591
.analog_in
import AnalogIn
13 thermistor
=AnalogIn(pcf
,PCF
.A0
)
14 R
=10000/(65535/thermistor
.value
- 1)
15 def steinhart_temperature_C(r
,Ro
=10000.0,To
=25.0,beta
=3950.0):
16 steinhart
=math
.log(r
/Ro
)/beta
17 steinhart
+=1.0/(To
+ 273.15)
18 steinhart
=(1.0/steinhart
) - 273.15
21 print(steinhart_temperature_C(R
),(datetime
.datetime
.now()))