View Single Post
  #12   Spotlight this post!  
Unread 26-10-2010, 20:46
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: How do i add two "True" values

For cases like these, where you have several boolean values that are used in evaluating for several situations, I use what I call a boolean state table to represent the desired functionality.
Here's a screenshot from my old software development guide:


The example this was for had a left and right drive control for inputs 1 and 2, bumper switches on 3 and 4, and an "auto navigation" toggle on input 5.

One way of coding this is to take each row and evaluate it with boolean logic, then bundle the results into a boolean array. With the boolean array you can use the following code:
__________________
-- Marshal Horn
Reply With Quote