Go to Post quick everyone find everything in the whole world that sells for $125 so we can get an edge on our building 2 days before kick off.....ready...go! - Greg Needel [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-05-2014, 22:15
dmaciel10123 dmaciel10123 is offline
The Everything Guy
AKA: David Maciel
FRC #3525 (The Nuts and Bolts of Fury)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 100
dmaciel10123 is an unknown quantity at this point
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?
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 11-05-2014, 22:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-05-2014, 07:49
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,367
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-05-2014, 20:43
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Methods for Single Button Swapping

I believe the attached VI is suitable for what you are looking for.
Attached Files
File Type: vi Latch.vi (14.5 KB, 11 views)
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
Reply


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


All times are GMT -5. The time now is 20:14.

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