ok, so this is a bit complicated, you will need a gyro to do this, or, you will need to know something to give you information about how many degrees you have turned. something like encoders would be ideal for this
the encoders are the easy way, but I think the gyro is a better way.
for the encoders, lets say you wanted to turn left you would say
LeftEncoderValue = RightEncoderValue = 0;
while( LeftEncoderValue > - target && RightEncoderValue < target){
leftdrivemotor = -127;
righDriveMotor = 127;
}
leftdrivemotor = rightdrivemotor = 0;
target would be something you determined experimentally, it would be the number of encoder tics to get to a 180 degree turn.
The other way would be to using a gryo. Using a gyro will allow you to turn to any angle, both relative to the field and relative to the robot. For example, you could turn 90 degrees to the left of where you are NOW, or you could turn to 90 degrees relative to the field.
for example, when I say relative to the field, I have a model for my robot, where if you stand where the drivers in a match stand, looking towards the side of the field with the goals on it, 0 degrees it directly to the right, and 90 degrees is directly in front of you. This allows you to point to a given direction, regardless of where you are facing at the moment you activate the command. Now I don’t know how easyC works, but to activate the command when you press a button in RobotC it would work like this
if(vexRT[Btn8D] == 1){
LeftEncoderValue = RightEncoderValue = 0;
while( LeftEncoderValue > - target && RightEncoderValue < target){
leftdrivemotor = -127;
righDriveMotor = 127;
}
leftdrivemotor = rightdrivemotor = 0;
}
Btn8D is a certain button on the vex controller, you could use any button you wanted
if you are interested in doing the gyro method let me know, I can post the code here for you