I have three buttons. Lets call the first one button 1 this is a bool by one press it's true by another press it's false. I have button 2 this is also a bool by one press it's true by another press it's false.
I have also button 3 this one is different it's only true if the button is pressed.
And as you could read in the title, 2 outputs these are also bools.
I want that if I press button 3 that output 1 goes/is on and output 2 goes/is off. If I press another time button 3 I want that output 1 is/goes off and output 2 goes/is on. If I press another time button 3 I want that output 1 goes/is on and output 2 goes/is off. And so on. It's needs to overruled the other two buttons I mention earlier.
And I want that if I press button 1 output 1 goes on or off. And I want that if I press button 2 output 2 goes on or off. This needs too overruled button 3.
I tried a lot but couldn't find a solution. This is what I have so far. See the attachments and:
TS19 = button 1
TS20 = button 2
knop_rechts_links = button 3
ventiel22 = output 1
ventiel21 = output 2
But it's not working good when I change output 1 or 2 with buttons 1 or 2 and press then button 3 it works the opposite, all the outputs goes on or off.
<whatever> = initial condition
Px = pressed button x (either momentary or latching)
Rx = released button x (either momentary or latching)
Oxy = output x has state y (T = on, F = off)</whatever>
Button 1 and 2 are latching, button 3 is momentary
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Goodday,
I have three buttons. Lets call the first one button 1 this is a bool by one press it's true by another press it's false. I have button 2 this is also a bool by one press it's true by another press it's false.
I have also button 3 this one is different it's only true if the button is pressed.
And as you could read in the title, 2 outputs these are also bools.
I want that if I press button 3 that output 1 goes/is on and output 2 goes/is off. If I press another time button 3 I want that output 1 is/goes off and output 2 goes/is on. If I press another time button 3 I want that output 1 goes/is on and output 2 goes/is off. And so on. It's needs to overruled the other two buttons I mention earlier.
And I want that if I press button 1 output 1 goes on or off. And I want that if I press button 2 output 2 goes on or off. This needs too overruled button 3.
I tried a lot but couldn't find a solution. This is what I have so far. See the attachments and:
TS19 = button 1
TS20 = button 2
knop_rechts_links = button 3
ventiel22 = output 1
ventiel21 = output 2
But it's not working good when I change output 1 or 2 with buttons 1 or 2 and press then button 3 it works the opposite, all the outputs goes on or off.
Everything is welcome. Thanks in advance!
Last edit: edwin200000 2022-08-05
I have simplified the code. I made from button 3 a bool. And when true stand_links and when false stand_rechts.
But got the same problem.
Last edit: edwin200000 2022-08-05
Well, please explain what values you want O1 and O2 to assume at each point of the following sequences (all starting from not pressed / scratch):
I guess some, based on your post:
<whatever> = initial condition
Px = pressed button x (either momentary or latching)
Rx = released button x (either momentary or latching)
Oxy = output x has state y (T = on, F = off)</whatever>
Button 1 and 2 are latching, button 3 is momentary