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.

Meeting room with separation wall
#1
Hi

I am trying to make a script for two meeting rooms with a separation wall. When the wall is open the two rooms should work as one, but when the wall is closed, each room should work seperately.

I have managed to create a script that sends the commands from the push button in room 1 to the eqvivalent GA's in room 2, but when I create the same for room 2 both scripts will run in infinite loops as they trigger each other.

the code I have used so far is:

ga = event.dst
value = event.getvalue()

Magnet = {'1/1/37'} -- Input indicates if wall is open or not
Input = {'1/1/33', '1/1/35'} -- Input addresses from room 1. 
Output = {'1/1/34', '1/1/36'} -- Adresses in room 2.

-- When pushin buttons in room 1
for id, addr in ipairs(Input) do
  if ga == addr and Magnet == true then
    grp.write(Output[id], value)
    end
end
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply


Messages In This Thread
Meeting room with separation wall - by Trond Hoyem - 07.03.2017, 08:17

Forum Jump: