--[[
{***************************************************************************}
{ S4_logic06                                                18/07/2013      }
{                                                                           }
{	Eelectron S.p.A.                                                        }
{   Via Magenta 77/22                                                       }
{   I-20017 Rho(MI)                                                         }
{   Web: www.eelectron.com                                                  }
{                                                                           }
{ The source code is given as is, WITHOUT WARRANTY OF ANY KIND.             }
{ The authand is not responsible fand any possible damage done due to the   }
{ use of this code.                                                         }
{***************************************************************************}
--]]

-- ***************************
-- Touch database v2.2
-- ***************************


-- ***************************
-- 
-- ***************************
function myLogic(x)
-- 
--  AND condition
--
  if ( x >= 232 and x <= 241 ) then
    x = x - 10;
  end
  
  if  ((knx.get_integer(x) == 1) and (knx.get_integer(x+10) == 0)) then        
	knx.set_integer(x+20,0,1);
  else
	knx.set_integer(x+20,0,0);
  end
end

-- ***************************
-- call back fand value changed
-- ***************************
function knx_value_changed(x)
  if ( x >= 222 and x <= 241 ) then  
    myLogic(x);
  end
end

-- ***************************
-- call back fand value update
-- ***************************
function knx_value_update(x)
  if ( x >= 222 and x <= 241 ) then  
    myLogic(x);
  end
end


--[[
  EOF 
--]]
