How to define a variable

ok so i want to make a function void RightTurn (int turn, int speed) { so on so forth but how do i make it that right turn = 90 degrees

So, if you’re making a method then there shouldn’t be anything in the parentheses. making a variable has no conditions thus nothing in the parentheses. This is basically what yours should look like.

void rightTurn() {
  motor ( directionType::fwd/rev, 90, rotationUnits:: revs/degrees  ) ; 
}

direction type you either put fwd or revers ( either turning left or right ) depends on the orientation of the motor. rotationUnits you put degrees for 90 degrees :slight_smile:
Hopefully this helps

EDIT : Please format your code using 3 consecutive ( ` ) before and after your code

4 Likes

That is correct. We do not define a variable for this. But in case this thread pops up in someone’s search in regards to defining variables, here: C++ VEXCode V5 Text Tutorials - Variables, if, else if, else, and while Statements - YouTube

1 Like