What to do?
Code...
function ReadHTU()
htu=require("htu21")
htu.init(sda,scl)
humi=htu.getHumidity()
temp=htu.getTemperature()
fare=(temp*9/5+32)
print("Humidity: "..string.format("%.1f",humi).."%")
print("Temperature: "..string.format("%.1f",temp).." deg C")
print("Temperature: "..string.format("%.1f",fare).." deg F")
-- release module
htu=nil
package.loaded["htu"]=nil
end
and Output......
NodeMCU 0.9.5 build 20150311 powered by Lua 5.1.4
I2C init done
Humidity: 51.8%
Temperature: 22.6 deg C
Temperature: 72.6 deg F
Wake up run 4.7 s
>
Hard Restart 16. březen 2015 19:31:54
I2C init done
Humidity: 51.8%
Temperature: Infinity deg C
Temperature: 72.6 deg F
Wake up run 4.8 s