View Single Post
  #1   Spotlight this post!  
Unread 21-04-2016, 12:31
Dpurry23's Avatar
Dpurry23 Dpurry23 is offline
Programmer/Control System/Scout
AKA: Darian Purry
FRC #0207 (Metalcrafters)
Team Role: Programmer
 
Join Date: Sep 2013
Rookie Year: 2012
Location: Hawthorne
Posts: 13
Dpurry23 is an unknown quantity at this point
Thumbs down NavX: Trying to rotate to angle without PID

Code:
             double turnDegrees = ahrs->GetYaw();
      
             while(codriver.GetRawButton(12) == 1)
             {
            	 if(turnDegrees > -10 && turnDegrees < 10 && centered == FALSE )
            	 {
            		 myRobot.Drive(0.0, 0.0);
            		 centered = TRUE;

            	 }
            	 else if (turnDegrees < -11 && turnDegrees > -180 && centered == FALSE)
            	 {
            		 myRobot.Drive(0.4, 1.0);
            		 centered = FALSE;
            	 }
            	 else if (turnDegrees > 11 && turnDegrees < 180 && centered == FALSE)
            	 {
            		 myRobot.Drive(-0.4, 1.0);
            		 centered = FALSE;
            	 }
             }
This is code I have come up with so far any suggestions would help.
Thank You!!

Last edited by Dpurry23 : 21-04-2016 at 12:47. Reason: Syntax
Reply With Quote