1900X/Clyde Auton 10.15.c
void rotateDegrees(int position, int direction) {//This function is for turning
	SensorValue[gyro] = 0;
	//Clear gyro
	if(direction == 1){
		//If direction == Left
		while(abs(SensorValue[gyro]) < position){
			//While the gyro is less than a set degrees, turn Left
			setRightDtMotors(45,45);
			setLeftDtMotors(-45,-45);
		}
		setRightDtMotors(-30,-30);
		setLeftDtMotors(30,30);
		wait1Msec(100); //brief brake
	}
	//end of LEFT turn
	else{
		//if direction == right
		while(abs(SensorValue[gyro]) < position){
			//While the gyro is less than a set degrees, turn right
			setRightDtMotors(-45,-45);
			setLeftDtMotors(45,45);
		}

		setRightDtMotors(30,30);
		setLeftDtMotors(-30,-30);
		wait1Msec(100); //brief brake
	} //end of RIGHT turn
	setRightDtMotors(0,0);
	setLeftDtMotors(0,0);

}
//rotate the robot a certain amount
//@param deg The number of degrees to turn; positive values are counterclockwise, negative values are clockwise.
//@param direction The direction to turn in to get to the position; 1 is counterclockwise, -1 is clockwise
rotate the robot a certain amount
rotate the robot a certain amount
void rotateDegrees(int position, int direction) {
	SensorValue[gyro] = 0;
	if(direction == 1){
		while(abs(SensorValue[gyro]) < position){
			setRightDtMotors(45,45);
			setLeftDtMotors(-45,-45);
		}
		setRightDtMotors(-30,-30);
		setLeftDtMotors(30,30);
		wait1Msec(100); 
	}
	else{
		while(abs(SensorValue[gyro]) < position){
			setRightDtMotors(-45,-45);
			setLeftDtMotors(45,45);
		}
		setRightDtMotors(30,30);
		setLeftDtMotors(-30,-30);
		wait1Msec(100); 
	} 
	setRightDtMotors(0,0);
	setLeftDtMotors(0,0);
}
void rotateDegrees ( int position , int direction ) { SensorValue [ gyro ] = 0 ; if ( direction == 1 ) { while ( abs ( SensorValue [ gyro ] ) < position ) { setRightDtMotors ( 45 , 45 ) ; setLeftDtMotors ( -45 , -45 ) ; } setRightDtMotors ( -30 , -30 ) ; setLeftDtMotors ( 30 , 30 ) ; wait1Msec ( 100 ) ; } else { while ( abs ( SensorValue [ gyro ] ) < position ) { setRightDtMotors ( -45 , -45 ) ; setLeftDtMotors ( 45 , 45 ) ; } setRightDtMotors ( 30 , 30 ) ; setLeftDtMotors ( -30 , -30 ) ; wait1Msec ( 100 ) ; } setRightDtMotors ( 0 , 0 ) ; setLeftDtMotors ( 0 , 0 ) ; }
rotate the robot a certain amount
rotate the robot a certain amount
//This function is for turning //Clear gyro //If direction == Left //While the gyro is less than a set degrees, turn Left //brief brake //end of LEFT turn //if direction == right //While the gyro is less than a set degrees, turn right //brief brake //end of RIGHT turn