Greetings,
Played around more and not having any success with the ds18b20 module or the example. I was able to move function 'addrs()' from 'ds18b20.lua' into my own test code and I could get the address of the 3 sensors I have connected. So I am definitely missing something in identifying and/or using the module.
At the top of my test code I have this:
It is the same as in the example.
Within the ds18b20.lua code, I see this:
Code: Select all--------------------------------------------------------------------------------
-- Set module name as parameter of require
local modname = ...
local M = {}
_G[modname] = M
--------------------------------------------------------------------------------
It is a bit mysterious.
Does it mean I should change the "..." to C, F, or K? or something else?
Or is it just a comment telling the user what is happening?
I see in the example that C, F and K are part of the request for temperature. So the "..." isn't supposed to be any of these.
Code: Select all-- Get temperature of first detected sensor in Fahrenheit
print("Temperature: "..t.read(nil,t.F).."'F")
I am very new at Lua and haven't done much in any other language for about 20 years. I have purchased the '5.1 Reference Manual' and 'Programming in Lua'. They were just delivered yesterday.
Thank you!
Best regards,
Fred
Link:
https://github.com/nodemcu/nodemcu-firmware/tree/master/lua_modules/ds18b20