13.09.2016, 06:26
Or you can just modify setoutput function to send boolean true when value >= 10, false otherwise:
Code:
function PID:setoutput()
local t, value
self.output = math.max(self.output, self.params.min)
self.output = math.min(self.output, self.params.max)
value = math.floor(self.output) >= 10
t = type(self.params.output)
if t == 'string' then
grp.write(self.params.output, value, dt.bool)
elseif t == 'table' then
for _, output in ipairs(self.params.output) do
grp.write(output, value, dt.bool)
end
end
end