I've used
this picture a couple times in recent days ... used to help provide advice on joystick buttons and throttle.
Now the shoe is on the other foot and I'd like to
ask for some advice.
I wasn't the SW mentor last year, but I seem to remember a VI/block that let you detect the
rising edge of a joystick button. I can't seem to find it in this year's LabView installation.
In the linked picture, buttons 3,4, & 5 are used to determine the next state of the Drive state-machine. The image shows some code from the Normal Drive state. When 3 or 4 or 5 is pressed, I set some variables and the next time through the loop, the state will change to the next state. After the maneuver is complete, the state goes back to Normal.
Problem is, if the driver leaves their finger on the button, then it will only stay in the normal state for one cycle, then immediately transition into the maneuver again, over and over and over. I'd rather require the operator to press the button again.
My current band-aid solution is to use a timer (not shown) where I grab the current time when the button is pressed, add a one-second offset, and store it in the Drive shift register. While the current time is less than the offset time, I disable the buttons by AND-ing them with a FALSE. When the current time is greater than the offset time, I re-enable the buttons by AND-ing them with a TRUE.
It'd be a lot cleaner if I could simply drop a box in there that would detect the
rising edge.
Any tips/tricks/advice would be greatly appreciated.
Thanks.