IF gate | |
ID | 79 |
---|---|
Category | Signal-i2o1 |
Sublayer width | 14 |
If binary value of IN1
is 1.0, output the unmodified value of IN0
to OUT0
.
The input IN1
is binary, its value is rounded so any value ≥0.5 is equal to 1.
local in0 = this:read(0)
if in0 >= 0.5 then
this:write(0, in0)
else
this:write(0, 0)
end
IN0
: ValueIN1
: ConditionOUT0
: if IN1 then IN0 else 0