Bien avancé mais cela ne marche plus :-(
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
-- source: https://nodemcu.readthedocs.io/en/master/modules/ds18b20/
|
||||
|
||||
function a1()
|
||||
print("\n a1.lua zf190601.1627 \n")
|
||||
print("\n a1.lua zf190616.1453 \n")
|
||||
end
|
||||
|
||||
a1()
|
||||
@@ -13,10 +13,23 @@ ds18b20.setup(ow_pin)
|
||||
|
||||
print("toto182538")
|
||||
|
||||
ztemp1=0 ztemp2=0 ztemp3=0
|
||||
|
||||
-- read all sensors and print all measurement results
|
||||
ds18b20.read(
|
||||
function(ind,rom,res,temp,tdec,par)
|
||||
print(ind,string.format("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",string.match(rom,"(%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%d+)")),res,temp,tdec,par)
|
||||
-- print(ind,string.format("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",string.match(rom,"(%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%d+)")),res,temp,tdec,par)
|
||||
print(ind,temp)
|
||||
if ind == 1 then
|
||||
ztemp1 = temp
|
||||
elseif ind == 2 then
|
||||
ztemp2 = temp
|
||||
elseif ind == 3 then
|
||||
ztemp3 = temp
|
||||
--C'est la fin de lecture, on envoie les mesures à ThingSpeak
|
||||
print(ztemp1,ztemp2,ztemp3)
|
||||
disp_send()
|
||||
end
|
||||
end,{})
|
||||
|
||||
print("tutu152603")
|
||||
|
||||
Reference in New Issue
Block a user