Attached below is a snippet from our code. What I am trying to do is take a joystick button into a routine that makes that input “sticky.” (First Logic Input). This is at the lower left of the snippet, and should be apparent. This is intended to control a solenoid.
What I want to do is take another T/F logical input (Second Logic Input) and be able to force the solenoid off when this second logic input is true. I’ve added another select function at the upper right of the snippet, and I believe this will solve part of what I am trying to do, but I don’t think it is the correct solution.
As this code is written, I am fairly certain that as soon as the second logic input returns to false, the “sticky” first input will retain its prior state and force the solenoid back on if the “sticky” input was previously True. What I want is the second logic input to do is reset the whole function and turn the solenoid off. I am just not sure about how to do this.
I hope my question makes sense, and I hope the snippet relays how the code currently looks. Sorry about the broken wires; this is just a sub-selection of the larger program, and the wires broke when I took the saved the snippet.
Any help is appreciated!