22.12.2016, 10:47
You can use this helper function:
Code:
function getbit(value, nr)
value = bit.rshift(value, nr)
return bit.band(value, 1)
end
value = mb:readregisters(123)
if value then
dampers_open = getbit(value, 0)
fire_dampers_open = getbit(value, 1)
...
end