FIRST Robotics Competition Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Joystick Button where the Boolean Remains True Snippet

Whit-E_Wall-E
NI Employee (retired)

In LabVIEW when using Booleans you can generally adjust the mechanical action of the Boolean to be a switch or latch depending on how you would like it to respond when turned on.  However, with most joysticks all your Booleans will behave like a latch unless you continue to hold down the button so you can adjust for that programmatically using a Feedback Node and a Case Structure.  In this snippet when the joystick button is pressed it will stay true until the button is pressed again to turn the value back to false.  This can be used if you want a button to adjust something for an extended period of time and you don't have to continue to press the joystick button.

There is a similar example on how to complete this desired action in the NI Example Finder:  Help >> Find Examples >> Browse Tab by Task >> FRC Robotics Folder >> Joystick >> "Joysitck Button Latching.lvproj"

You can also learn more about the mechanical action of Booleans in the NI Example Finder: Help >> Find Examples >> Search Tab >> Enter mechanical as the keyword >> Select "Mecanical Action of Booleans.vi"

Boolean Button Stay True.png

Regards,

M. Whitaker
ni.com/support