View Single Post
  #6   Spotlight this post!  
Unread 22-02-2014, 10:47
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: BCD switch programming

Quote:
Originally Posted by SoftwareBug2.0 View Post
A quick grep of the 1425 2014 robot code reveals 67 switch statements. Do you code your state machines with a bunch of "if" statements?
I use LV, so a Case Structure is the same a both an If and a Switch. There's also a Select, which picks one of two inputs based on a boolean input. In normal programming (in C), I use Switch/Case all the time, usually for states.

FOR loops, on the other hand, have very limited use in controls programming. In general, you can use something else (such as a ratcheting counter) where a lot of new programmers use For loops and history buffers.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack