I/O problem- why won't this work for me?

Avatar
tile
380 Posts
Posted Oct 05, 2013
here's my setup:

there are 2 floor buttons, but one of them is on a wall. the one on the wall needs to stay activated for 20 sec, then disable. the one on the floor, however, works exactly like you'd expect it to. i need a door to open whenever both buttons are activated, then close when only one or neither are activated.

my problem is that the indicator lights and the door's open/closed state seem to have a random outcome whenever the button on the wall is pressed a second time.

Advertisement
Registered users don’t see ads! Register now!
Avatar
TeamSpen210
608 Posts
Posted Oct 05, 2013
Replied 9 minutes later
What logic entities are you using? I'd use a logic-relay for the timer. The wall button would OnPressed open the door, then OnUnPressed trigger the relay, which would close the door after a 20sec delay. The wall button also needs to CancelPending the relay when pressed to stop the outputs.

I'd use a logic_coop_manager to combine the buttons together properly.

Avatar
tile
380 Posts
Posted Oct 05, 2013
Replied 56 minutes later

TeamSpen210 wrote:
What logic entities are you using? I'd use a logic-relay for the timer. The wall button would OnPressed open the door, then OnUnPressed trigger the relay, which would close the door after a 20sec delay. The wall button also needs to CancelPending the relay when pressed to stop the outputs.

I'd use a logic_coop_manager to combine the buttons together properly.

specifics on how to use the coop manager please?

Avatar
greykarel
225 Posts
Posted Oct 05, 2013
Replied 10 minutes later
For timed floor button check my post in this thread. Then I would use a math_counter with initial value 0 and max value 2 and have outputs from buttons add 1 on activated and substruct 1 on deactivated. And from math_counter to door on hit max >> open, on change from max >> close.
Avatar
TeamSpen210
608 Posts
Posted Oct 05, 2013
Replied 53 minutes later
Logic_coop-managers have the 4 inputs setStateATrue, setStateBTrue, setStateAFalse,SetStateBFalse. Make one button set stateA true/false when pressed/unpressed, and the same for the other button and StateB. Use the outputs OnChangedToAllTrue (open) and OnChangedToAnyFalse (close).
Advertisement
Registered users don’t see ads! Register now!
Avatar
srs bsnss
552 Posts
Posted Oct 06, 2013
Replied 9 hours later

TeamSpen210 wrote:
Logic_coop-managers have the 4 inputs setStateATrue, setStateBTrue, setStateAFalse,SetStateBFalse. Make one button set stateA true/false when pressed/unpressed, and the same for the other button and StateB. Use the outputs OnChangedToAllTrue (open) and OnChangedToAnyFalse (close).

This is the most efficient way to do AND-gates. With regards to timed buttons, from what I can tell you want the button, as soon as it is pressed in, to start counting down 20 seconds of activation. After that 20 seconds, it's deactivated. In which case, I would use OnPressed > logic_timer > Enable and OnPressed > desired output > enable

Make the logic timer last for 20 seconds in it's settings, then give it the output: OnTimer > desired output > disable.