View Single Post
  #2   Spotlight this post!  
Unread 02-02-2009, 17:05
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Toggling boolean using 2 limit switches

This is how I would do it in C:

Code:
boolean myBool = false;

if( switch1 )
  myBool = true;
else if( switch2 )
  myBool = false;

// If neither switch is pressed, then myBool keeps its old value
Making a VI out of that is left as an exercise to the reader
Reply With Quote