ds18b20 and ow.search(pin) bug
Posted: Fri Jul 03, 2015 9:21 am
Hi,
I'm trying to connect multiple DS18B20 sensors to ESP8266.
My test code is something like this:
I'm getting something like that:
I think that something is not right with ow.search() function. In my case it says that I have no sensors connected but it get temperature from the sensor...
I'm trying to connect multiple DS18B20 sensors to ESP8266.
My test code is something like this:
Code: Select all
require("ds18b20")
ds18b20.setup(1)
addrs = ds18b20.addrs()
if (addrs ~= nil) then
print("Total DS18B20 sensors: "..table.getn(addrs))
end
-- Don't forget to release it after use
t1=ds18b20.read()
print(string.format("temperature: %.1f °C", t1))
ds18b20 = nil
package.loaded["ds18b20"]=nil
I'm getting something like that:
Code: Select all
Total DS18B20 sensors: 0
temperature: 28.6 °C
I think that something is not right with ow.search() function. In my case it says that I have no sensors connected but it get temperature from the sensor...