Change address printing to Hex from Base64.
@@ -17,7 +17,7 @@ return({
local pin = self.pin
for i,s in ipairs(self.sens) do
if s.status == 0 then
- print("starting conversion:", encoder.toBase64(s.addr), s.parasite == 1 and "parasite" or " ")
+ print("starting conversion:", encoder.toHex(s.addr), s.parasite == 1 and "parasite" or " ")
ow.reset(pin)
ow.select(pin, s.addr) -- select the sensor
ow.write(pin, 0x44, 1) -- and start conversion
@@ -50,7 +50,7 @@ return({
ow.write(pin, 0xB4, 1) -- Read Power Supply [B4h]
local parasite = (ow.read(pin)==0 and 1 or 0)
table.insert(self.sens,{addr=addr, parasite=parasite, status=0})
- print("contact: ", encoder.toBase64(addr), parasite == 1 and "parasite" or " ")
+ print("contact: ", encoder.toHex(addr), parasite == 1 and "parasite" or " ")
end
addr = ow.search(pin)
@@ -68,7 +68,7 @@ return({
local next = false
if not self.sens then return 0 end
for i,s in ipairs(self.sens) do
- -- print(encoder.toBase64(s.addr), s.status)
+ -- print(encoder.toHex(s.addr), s.status)
if s.status == 1 then
ow.reset(pin)
ow.select(pin, s.addr) -- select the sensor
@@ -91,14 +91,14 @@ return({
if tH and (tH~=85) then
self.temp[s.addr]=(sgn<0 and "-" or "")..tH.."."..tL
- print(encoder.toBase64(s.addr),(sgn<0 and "-" or "")..tH.."."..tL)
+ print(encoder.toHex(s.addr),(sgn<0 and "-" or "")..tH.."."..tL)
s.status = 2
end
-- end integer version
-- -- float version
-- if t and (math.floor(t/10000)~=85) then
-- self.temp[s.addr]=t
- -- print(encoder.toBase64(s.addr), t)
+ -- print(encoder.toHex(s.addr), t)
-- s.status = 2
-- end
-- -- end float version
@@ -116,4 +116,3 @@ return({
end
})
-
