Merge pull request #946 from SebastianSchildt/fixds18b20
Fix unit constants to be consistent with code
This commit is contained in:
commit
4f330e4500
|
@ -13,6 +13,14 @@ end
|
|||
-- Just read temperature
|
||||
print("Temperature: "..t.read().."'C")
|
||||
|
||||
-- Get temperature of first detected sensor in Fahrenheit
|
||||
print("Temperature: "..t.read(nil,t.F).."'F")
|
||||
|
||||
-- Query the second detected sensor, get temperature in Kelvin
|
||||
if (table.getn(addrs) >= 2) then
|
||||
print("Second sensor: "..t.read(addrs[2],t.K).."'K")
|
||||
end
|
||||
|
||||
-- Don't forget to release it after use
|
||||
t = nil
|
||||
ds18b20 = nil
|
||||
|
|
|
@ -33,9 +33,9 @@ setfenv(1,M)
|
|||
--------------------------------------------------------------------------------
|
||||
-- Implementation
|
||||
--------------------------------------------------------------------------------
|
||||
C = 0
|
||||
F = 1
|
||||
K = 2
|
||||
C = 'C'
|
||||
F = 'F'
|
||||
K = 'K'
|
||||
function setup(dq)
|
||||
pin = dq
|
||||
if(pin == nil) then
|
||||
|
|
Loading…
Reference in New Issue