View Single Post
  #1   Spotlight this post!  
Unread 25-11-2015, 13:24
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Off Season Programming Question: Switch Statements

Quote:
Originally Posted by GeeTwo View Post
Did you put this in the IsAutonomous && IsEnabled loop?


Yes. I figured out the problem and I'm trying to think of a way to fix it.

Code:
case 2:
     if(pid.OnTarget()){
          step++;
     }
     break;
That section of code is not change the value of step. I put "step" on the smart dash board and once it gets to case 2 it doesn't move on to case 3. I also checked the value of the encoder with the smart dashboard and it is getting to get set point.


EDIT: I just put the pid.OnTarget(); on the smart dashboard; it never changes to true. I cant figure out why.

Last edited by tomy : 25-11-2015 at 13:32.
Reply With Quote