Go to Post Think, Write, Re-Think, Erase or Post - and Deal With it Either Way. - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 05-02-2010, 09:26
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Joystick Button One-Shot (a.k.a. Rising Edge) Detection

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.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ellipse Finding/Edge Detection Example Code? brianc217 NI LabVIEW 3 20-01-2010 08:57
Full solenoid controll off of one joystick button? m3rc1l3ss NI LabVIEW 2 11-02-2009 02:06
joystick button furiousgeorge Programming 5 07-02-2009 15:57
Ganged Interrupt Edge Detection cprogrammer Programming 8 01-02-2008 10:52
More than one joystick from one port Jmoo Programming 3 26-06-2003 18:01


All times are GMT -5. The time now is 22:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi