This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

PID thermostat with LogicMachine
#4
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
Reply


Messages In This Thread
RE: PID thermostat with LogicMachine - by admin - 13.09.2016, 06:26

Forum Jump: