Control Channel Power

v, t = pcb.power_out(chnl, enale)
v, t = pcb.power_out() -- read

Parameter Type Description
chnl integer Channel 1-4 (8 for OUT_CNT)
enable boolean True = power forced
Returns Type Description
v integer Bit field
t table Table of enabled bits

Power Table

The value for the table t contains the bits that are enabled.

function FindInTable(t, lookfor)
 local i, v
 for i,v in pairs(t)
 do
  if v == lookfor
  then return i
  end
 end
 return nil
end

local v, t = pcb.power_oout()

if FindInTable(t, 4)
then
  -- COM4 POWER is enabled
end