04.03.2015, 20:20
Use a boolean, and set it to true when opening the gate, and false when closing it.
Thereby you can use a switch to detect if it's set to false(closed), you should open the gate, and if it's set to true(opened), you should close the gate.
Thereby you can use a switch to detect if it's set to false(closed), you should open the gate, and if it's set to true(opened), you should close the gate.