Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Methods for Single Button Swapping (http://www.chiefdelphi.com/forums/showthread.php?t=129432)

dmaciel10123 11-05-2014 22:15

Methods for Single Button Swapping
 
Hi guys! So, in my last post in here I posted a swap drive that I wrote. In it I allowed for a single button to be used to swap between modes. Of course, this could cause an issue because the loop normally runs faster than a person can quickly press a button. So to account for this I put a timer in that resets only when it allows the mode to be swapped after a certain period of time. I was just wondering, are there another other, more simple ways of doing this?

Alan Anderson 11-05-2014 22:20

Re: Methods for Single Button Swapping
 
Remember the state of the button the last time you checked it. If it is currently pressed but was not pressed before, then do the swap. Otherwise do nothing.

Gdeaver 12-05-2014 07:49

Re: Methods for Single Button Swapping
 
For now the question is about a button but, this leads to other questions about how to handle systems with change of state. Time to look into state machines. Two concepts that are very important to robot programming real time and state machines. We formally teach these concepts to our programming team.

adciv 12-05-2014 20:43

Re: Methods for Single Button Swapping
 
1 Attachment(s)
I believe the attached VI is suitable for what you are looking for.


All times are GMT -5. The time now is 08:53.

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