как считать температуру с DS1624
-
Вопрос. нужен работающий пример чтения данных температуры с DS1624/
найденный мною пример на raspberrypi/org выдает постоянно 6553.5, без каких либо изменений.
как правильно считать и обработать?пример
import smbus
import time
bus = smbus.SMBus(0)
address = 0x48def tempDS1624():
temp1 = bus.read_byte_data(address, 1)
temp2 = bus.read_byte_data(address, 2)
temp = (temp1 <<+ temp2
temp = temp/10.0
return tempwhile True:
temperature = tempDS1624() #this returns the value to 1 decimal place in degrees.
print temperature
time.sleep(1)