update drySensor function

This commit is contained in:
LazyAssassin445
2017-02-26 15:52:57 +00:00
parent 89a98e9393
commit dcb5d85855
2 changed files with 2 additions and 60 deletions

View File

@@ -38,7 +38,7 @@ def reset(extra = 0):
CONFIG_HRES_14 |
extra
)
bus.i2c([CONFIG_REG, config >> 8], 0)
bus.i2c([CONFIG_REG, config >> 8, config & 0xff], 0)
def temperature():
# Request temperature measurement
@@ -68,10 +68,9 @@ def drySensor():
# Take 1000 reading as fast as possible
# (the heater is only activated when performing a reading)
for x in range(10000):
for x in range(1000):
try:
temperature()
time.sleep(0.1)
except: pass
# Turn off the heater