View Single Post
  #2   Spotlight this post!  
Unread 20-01-2012, 17:11
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: How does this program look?

Quote:
Originally Posted by Joe Ross View Post
One good practice is to make your programs flow from right to left. I would put your Set Output to the right of your case statement, so that it is easier to read.
Particularly since it looks like that wire is going into a terminal on the right side of the Set Output VI.

Overall, the concept is sound, and that will compile and run (you can also tell by looking at the run arrow in the upper left - if it is broken, you have a compile problem, if it's white, it will compile). However, as pointed out, you want an input in the range -1 to 1 (that's why it's coercing your integer, that's what the red dot means). And make sure you are setting it to zero in the false. To simplify things, I would check out the select block on the comparison pallete. This will take a boolean input (your button) and choose one of two outputs as its output based on the boolean. The case structure is better suited to more radically altering the flow of code conditionally. And just to keep things clean, you won't need the axes unbundled on the second joystick if you aren't using them.

Edit: I got ninja'd ^

Also, I'm pretty sure the select block has less overhead than the case structure, if that's a concern at all.

Last edited by Aren Siekmeier : 20-01-2012 at 17:15.
Reply With Quote