FIRST Robotics Competition Discussions

Showing results for 
Search instead for 
Did you mean: 

Need help with some logic

Go to solution

Attached to this note is a code snippet that is representative of a logic flow that we have for our robot.  Basically, Input 1 is a momentary input designed to toggle the output as a latch.  What I am trying to do is take a second input (Input 2) and make it toggle the output to false (and remain false).  The problem that I am having is that the shift registers are apparently remembering the previous input state and keeping the output on based on the prior state of Input 1.


I need assistance in figuring out how to program this structure so that when Input 2 is pressed, the output goes to false and remains that way.


Thank you!

0 Kudos
Message 1 of 6

I'm away from my computer right now, but the SR flip flop in the memory library does just that (


Check out this thread for an example of doing this controlling two Solenoids:

0 Kudos
Message 2 of 6

Thank you for your response...

I downloaded the SR flip flop, and I was successful in making a toggle-type switch using the .vi from the memory library.  I have not been successful in integrating the second input to reset the condition.  Any assistance you can provide is very much appreciated.

0 Kudos
Message 3 of 6

2019-03-30_17-35-28.pngTry this I did it quick so may have missed somethin

Champion CLA Instructor

Making senseless computers do
intelligent real world things
is NOT easy. SO MAKE IT FUN!
0 Kudos
Message 4 of 6

Here's the example from the page.buttonOnDifferentButtonOff.png


Only thing to note is that if you push both buttons it will continuously cycle until you let go of at least one of them.

You can make it only respond when only one is pressed by changing the Enable input from a True constant to a NotEqual of the buttons.

0 Kudos
Message 5 of 6
Accepted by topic author jonathanreid

Here is the code that ends up working in snippet form.  Thank you for everyone's assistance.



0 Kudos
Message 6 of 6