LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I increment/decrement a value each time a joystick button is pressed

Solved!
Go to solution

I'm trying to find a way to increment or decrement a value each time a joystick button (Boolean) is pressed.

 

The function in the tutorial i found makes the value go up by huge amountswhile the button is pressed, what i need is a way to have the value go up by x units every time the button is pressed.

 

i would use a timer, but sometimes, the button may be pressed very rapidly, or may be held.

 

in standard programming, i would have the system wait for the button to be pressed, then increment by one, and wait until the button was released before moving on. As of yet, i still have not found a way to do this.

 

-Zeno

0 Kudos
Message 1 of 2
(2,794 Views)
Solution
Accepted by topic author ZInventor

Just us a shift register and compare old and new values of the boolean.

 

Easiest would be the "implies function". If you connect it as shown in this recent example, you get a trigger whenever the boolean goes from off->on between two iteration.

Message 2 of 2
(2,783 Views)