13.09.2018, 14:35
(13.09.2018, 12:38)admin Wrote: You can use this function to list devices on a certain 1-Wire bus:
Code:require('ow') function list(bus) local res = {} local dir = ow.dir('/uncached/bus.' .. bus) or {} for _, entry in ipairs(dir) do local chunks = entry:split('/') if #chunks == 4 and chunks[ 4 ]:match('^%x%x%.') then res[ #res + 1 ] = chunks[ 4 ] end end return res end log(list(0)) log(list(1))
Thank you very much.
I will try it.