View Single Post
  #10   Spotlight this post!  
Unread 04-02-2011, 23:30
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: turning a push button into a switch

Based on your pseudo-code, I'm not sure why it would be toggling without anything pressed. However, it will definitely toggle every 10 ms when the button is pressed.

What you need to do is to save the state of the button in the previous loop and compare it to the value in the current loop and only do something when it changes. You can save old values using feedback nodes or shift registers.

Take a look at the "button action" examples from http://team358.org/files/programming...2009-/LabVIEW/
Reply With Quote